-
Notifications
You must be signed in to change notification settings - Fork 189
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
PyCall doesn't work with Enthought Canopy / EPD #42
Comments
Which version of Python are you using? The one that comes with OSX, Anaconda, or Enthought? |
I am using Enthought Canopy python 2.7 Sent from my iPad On 16 Sep, 2013, at 11:56 PM, "Steven G. Johnson" [email protected] wrote:
|
I too was having continual problems with pycall and Canopy. I just ended up switching to anaconda, which worked without incident. |
See also JuliaLang/IJulia.jl#86 |
Same here:
Everything looks fine when I switch to the system built-in Python. |
I just found that calling
before using any PyCall functions looks good. I guess making a symlink from libpython2.7.dylib to libpython.dylib in Canopy's distribution will also work. |
Are you sure that (The basic problem here seemsto be that Canopy's |
@stevengj You are right. I superficially thought that the error was caused by |
I have tried loading pythonxy version of python (PYTHON were set properly). Had the same issues during initialization under Windows 7 x64 (Julia Version 0.3.1 x86_64-w64-mingw32). Would be nice to get fixed as well.
|
@dpinte, any thoughts? |
@stevengj I started looking into the initialization code just after EuroScipy. On Windows, the issue seems to be with the initialization code in PyCall. From what I remember, the initialization will fail with any venv (on Python 3) or virtualenv setup or the venv backport that Canopy uses on Python 2.7. I'll try to dig a bit more into the issue and share my notes to make it work on Windows. The fix was not trivial though. On my OSX install, it worked like a charm without any changes (which is surprizing looking at what I've seen for Windows). I am using Canopy 1.4.1 and have the Canopy Python registered on my .profile. |
Thank, I appreciate any tips. The overriding goal here is to initialize Python correctly given only the name of the |
Thank you, guys! |
I'm using OS X 10.10 with Enthought Canopy Python 2.7.3. Basic imports seem to work fine: julia> using PyCall
julia> @pyimport math
julia> math.pi
3.141592653589793 But things involving MKL fail: julia> @pyimport scipy.optimize as so
ERROR: PyError (PyImport_ImportModule) <type 'exceptions.ImportError'>
ImportError('dlopen(/Users/mishmash/Library/Enthought/Canopy_64bit/System/lib/python2.7/site-packages/scipy/optimize/_lbfgsb.so, 2): Library not loaded: @rpath/libmkl_intel_lp64.dylib\n Referenced from: /Users/mishmash/Library/Enthought/Canopy_64bit/System/lib/python2.7/site-packages/scipy/optimize/_lbfgsb.so\n Reason: image not found',)
File "/Users/mishmash/Library/Enthought/Canopy_64bit/System/lib/python2.7/site-packages/scipy/optimize/__init__.py", line 147, in <module>
from ._minimize import *
File "/Users/mishmash/Library/Enthought/Canopy_64bit/System/lib/python2.7/site-packages/scipy/optimize/_minimize.py", line 29, in <module>
from .lbfgsb import _minimize_lbfgsb
File "/Users/mishmash/Library/Enthought/Canopy_64bit/System/lib/python2.7/site-packages/scipy/optimize/lbfgsb.py", line 40, in <module>
from . import _lbfgsb
in pyerr_check at /Users/mishmash/.julia/v0.3/PyCall/src/exception.jl:58
in pyimport at /Users/mishmash/.julia/v0.3/PyCall/src/PyCall.jl:85 Not sure if this is related to the above. Everything is fine using Anaconda. |
@mishmash yes, it is more than likely related to the same issue. I have zero time at the moment to propose a solution but plan to do it ... |
Whoops, didn't mean to close. |
@dpinte, a possibly related issue: Canopy Python fails to find As a result, I can't really call Py_SetPythonHome sensibly to set up the paths. In general, it seems like the difficulty is that Canopy is doing something unusual in how it sets up the Python paths, which is hard to replicate when loading |
(Note that if I just omit the |
When I type
@pyimport math
, I get this error message:Any idea what happens?
The text was updated successfully, but these errors were encountered: