Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User defined module #308

Closed
erdongwei opened this issue Aug 12, 2016 · 3 comments
Closed

User defined module #308

erdongwei opened this issue Aug 12, 2016 · 3 comments

Comments

@erdongwei
Copy link

erdongwei commented Aug 12, 2016

I can use Julia call packages of python, for example, @pyimport math
math.sin(math.pi / 4) - sin(pi / 4). However, when @pyimport the module I programmed, I cannot use the function in that module, and the error is UndefVarError. Seems Julia can see the module, but cannot see the function defined in that module.

@cstjean
Copy link
Collaborator

cstjean commented Aug 12, 2016

I'll take a wild guess that your Python module name is also the name of some other module. If you run names(your_module) after @pyimport, what do you see? Can you import your module in Python?

If that's not it, we'll need more information. Could you shrink down your code to a minimum and post it?

@stevengj
Copy link
Member

See #48 ... maybe you need to update the Python load path?

@erdongwei
Copy link
Author

@cstjean yeah, you are right, I changed the module name, and now it works. Thanks!
@stevengj Thanks, I have already used unshift!(PyVector(pyimport("sys")["path"]), "") .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants