在OSX 10.6.8上安装后无法导入PyBrain

时间:2012-04-01 16:25:11

标签: python pybrain

检查python版本

✈  python --version
Python 2.7.2

列出virtualenv

中的包裹
✈  pip freeze
PyBrain==0.3
numpy==1.6.1
scipy==0.10.1
wsgiref==0.1.2

加载解释器

>>> import numpy
>>> print numpy.__version__
1.6.1
>>> import scipy
>>> print scipy.__version__
0.10.1
>>> import pybrain
 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/pybrain/__init__.py", line 1, in <module>
from structure.__init__ import *
  File "/Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/pybrain/structure/__init__.py", line 2, in <module>
from modules.__init__ import *
  File "/Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/pybrain/structure/modules/__init__.py", line 2, in <module>
from gate import GateLayer, DoubleGateLayer, MultiplicationLayer, SwitchLayer
  File "/Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/pybrain/structure/modules/gate.py", line 11, in <module>
from pybrain.tools.functions import sigmoid, sigmoidPrime
  File "/Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/pybrain/tools/functions.py", line 4, in <module>
from scipy.linalg import inv, det, svd
  File "/Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/scipy/linalg/__init__.py", line 116, in <module>
from basic import *
  File "/Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/scipy/linalg/basic.py", line 14, in <module>
from scipy.linalg import calc_lwork
ImportError: dlopen(/Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/scipy/linalg/calc_lwork.so, 2): Symbol not found: __gfortran_concat_string
  Referenced from: /Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/scipy/linalg/calc_lwork.so
  Expected in: dynamic lookup

2 个答案:

答案 0 :(得分:1)

ImportError: dlopen(/Users/milktrader/.virtualenvs/pybrain/lib/python2.7/site-packages/scipy/linalg/calc_lwork.so, 2): Symbol not found: __gfortran_concat_string

我不确定 - 因为我之前没有搞过这个库 - 但你是否需要使用Fortran支持编译其中一个包?当我在工作时在我的Mac上安装numpy / scipy时,我必须安装GFortran所以框架的所有绑定和基础都将被正确设置。也许这就是为什么scipy正在为你而死。

答案 1 :(得分:0)

可能是因为默认情况下没有在OSX python上安装scipy。

试试这个来证明

>>> import scipy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named scipy
>>>