-
Notifications
You must be signed in to change notification settings - Fork 185
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
Module import causes errors in julia's shell mode #91
Comments
What operating system and Python distro are you using? Probably the problem is that PyCall is setting the |
I'm on Ubuntu. The environment variable does seem to be the issue. I forgot I was running my Julia REPL within a python virtual environment and after doing the PyCall import, the variable PYTHONHOME gets set to the virtual env root whereas it was unset before (PYTHONPATH is always unset). Mercurial does not break if I run Julia from just the normal environment. I guess there's not much of an option to change it unless PyCall doesn't need one of those variables set to work properly? |
I'm not sure if there is any clean way to fix it. The virtualenv Python you are using with PyCall and hg require different environments; the PYTHONHOME is required to tell libpython to use packages in the virtualenv path, I think. |
...unless there is a way to set the equivalent of PYTHONHOME in libpython without using an environment variable? |
Hmm, one hacky possibility could be to set This should work because, looking at the source code, Python only computes its search paths once and then caches the value; it never looks at |
I found if I remove |
Yeah, it looks like if I change the I'll go ahead and close it, since there's no obvious change and it's easy enough to just do |
No, I don't think it is safe to just set I'm going to re-open this issue; I think that the best thing is probably to unset |
Additionally, it's not even a specific PyCall or Julia issue. If I set I guess a fix should be theoretically possible though because the python interpreter in the virtual environment knows to search those paths as well, and it doesn't need to set any environment variables. |
It looks like |
Thanks for the followup! |
I've discovered things break if I try to interface with mercurial through Julia's shell commands (using ; in the REPL). I don't know enough to know what's going on behind the scenes, but somehow invoking external python software in the shell mode is being influenced by PyCall's behavior
Example:
I'm using the most recent version of Julia, 0.4.0-dev+719 (2014-09-21)
The text was updated successfully, but these errors were encountered: