-
Notifications
You must be signed in to change notification settings - Fork 187
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
Avoid loading libpython.so if Python symbols are already loaded globally #219
Conversation
The old behavior didn't work on Windows. |
@stevengj what part of it didn't work on Windows - PyCall alone or PyJulia? The windows CI tests seem to have passed (for 0.4 at least). |
pyjulia didn't work. |
@stevengj Are there changes that would make you happy to merge this anyway? PyJulia doesn't work for anyone at the moment - it can at least work on Ubuntu and possibly other platforms with this patch. The AppVeyor Windows tests are passing for 0.4 and failing for Julia 0.3. (Do you still need to support 0.3?) Let me know if I can help to get this working - it would be great to be able to call Julia from Python again. |
Bump, hoping we can resolve this. pyjulia not working is sad, means I can't share my code with python users. |
This is ugly, but I suppose it is okay for now. |
Avoid loading libpython.so if Python symbols are already loaded globally
I feel like the right thing would be for
|
I think I'm going to revert this patch for now, since it is causing problems in #229. Pending a better solution, pyjulia users will have to |
I've been trying to resolve JuliaPy/pyjulia#38 . On Ubuntu 14.04, Python is statically linked. So when we import PyCall in a Julia interpreter running inside a Python process, as we do with PyJulia, we have to avoid dlopen'ing libpython2.7.so - otherwise we end up with two Python interpreter states and bad things ensue.
The previous version used to handle this by using the one-argument cglobal call to effectively dlopen(NULL) and get handle to the global namespace - I've restored that behaviour here. It feels more complicated, perhaps because of changes that support precompilation in the current version - maybe there is a more elegant way.
I'll make a pull request to PyJulia complementing this as well.