简体   繁体   中英

Python, Anaconda, pybrain on a Mac

I installed anaconda, but I'm also using pip:

$ conda list scipy
# packages in environment at /Users/bjelline/anaconda:
#
scipy                     0.14.0               np19py27_0  
$ conda list pybrain
# packages in environment at /Users/bjelline/anaconda:
#
pybrain                   0.3                       <pip>

These two are supposed to work together, aren't they? when I do

/Users/bjelline/anaconda/bin/python -c "import pybrain"

I get an error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/bjelline/anaconda/lib/python2.7/site-packages/pybrain/__init__.py", line 1, in <module>
    from structure.__init__ import *
  File "/Users/bjelline/anaconda/lib/python2.7/site-packages/pybrain/structure/__init__.py", line 1, in <module>
    from connections.__init__ import *
  File "/Users/bjelline/anaconda/lib/python2.7/site-packages/pybrain/structure/connections/__init__.py", line 1, in <module>
    from full import FullConnection
  File "/Users/bjelline/anaconda/lib/python2.7/site-packages/pybrain/structure/connections/full.py", line 3, in <module>
    from scipy import reshape, dot, outer
ImportError: cannot import name reshape

any thoughts what the problem might be?

the problem wasn't anaconda, or python, or pip. The problem were files called

pybrain.py

and

scipy.py

in the current directory. the current directory is first in sys.path, so these files got loaded instead of the real libraries.

Note to self: never reuse a packages name as your own filename!

Try conda install -f scipy . This will force reinstall scipy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM