有一些关于enthough's Canopy和Julia的奇怪,它们是通过PyCall实现的(我想这与Canopy没有更新distutils.sysconfig??).
有一个some discussion可以通过指向正确的共享库来解决问题。
如何使此永久(如何更改PyCall)?
一些输出:

julia> using PyPlot
ERROR: could not load module python: dlopen(python.dylib, 9): image not found
 in pyinitialize at /Users/bdhammel/.julia/PyCall/src/PyCall.jl:422
 in pyimport at /Users/bdhammel/.julia/PyCall/src/PyCall.jl:105
 in include at boot.jl:238
 in include_from_node1 at loading.jl:114
 in reload_path at loading.jl:140
 in _require at loading.jl:58
 in require at loading.jl:43
at /Users/bdhammel/.julia/PyPlot/src/PyPlot.jl:32

julia> using PyCall

julia> pyinitialize("/Users/bdhammel/Library/Enthought/Canopy_64bit/System/lib/libpython2.7.dylib")
/Users/bdhammel/Library/Enthought/Canopy_64bit/System/lib/libpython2.7.dylib: /Users/bdhammel/Library/Enthought/Canopy_64bit/System/lib/libpython2.7.dylib: cannot execute binary file

julia> using PyPlot
Warning: Possible conflict in library symbol dtrtri_
Warning: Possible conflict in library symbol dgetri_
Warning: Possible conflict in library symbol dgetrf_

julia> plot([1,2])
1-element Array{Any,1}:
 PyObject <matplotlib.lines.Line2D object at 0x115b95090>

它画出了这条线
我想把这个设置为工作,而不必做distutils.sysconfig位。
从链接的讨论:
PyCall运行python可执行文件并执行:
import distutils.sysconfig
print(distutils.sysconfig.get_config_var('LDLIBRARY'))
print(distutils.sysconfig.get_config_var('PYTHONFRAMEWORKPREFIX'))

这些路径存储在哪里,我应该更改什么?
这些命令的python输出:
In [1]: import distutils

In [2]: print(distutils.sysconfig.get_config_var('LDLIBRARY'))
Python.framework/Versions/2.0.0.dev-f1c6cfc/Python

In [3]: print(distutils.sysconfig.get_config_var('PYTHONFRAMEWORKPREFIX'))
/Library/Frameworks

In [4]: distutils.__file__
Out[4]: '/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/__init__.pyc'

最后:我是否需要担心pyinitializecannot execute binary file部分?

最佳答案

请参见PyCall issue #42,这是本次讨论的正确位置。事情已经有所改善,但是在带有Canopy/EPD的Windows上仍然存在一些运行时路径问题,现在我建议使用Anaconda Python。

10-06 05:21