0

I'm having trouble getting numpy working with conda + python 2.7. It works fine with python 3, but when I try below I get "cannot import name scalarmath".

conda create -n test numpy python=2.7 --no-default-packages

source activate test

python -c 'import numpy'

Traceback (most recent call last): File "<string>", line 1, in <module> File "/Users/me/anaconda/envs/test/lib/python2.7/site-packages/numpy/__init__.py", line 153, in <module> from . import add_newdocs File "/Users/me/anaconda/envs/test/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module> from numpy.lib import add_newdoc File "/Users/me/anaconda/envs/test/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module> from .type_check import * File "/Users/me/anaconda/envs/test/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module> import numpy.core.numeric as _nx File "/Users/me/anaconda/envs/test/lib/python2.7/site-packages/numpy/core/__init__.py", line 20, in <module> from . import scalarmath ImportError: cannot import name scalarmath

matt_k
  • 4,139
  • 4
  • 27
  • 33

1 Answers1

0

You need to activate your environment with source activate test. This works for me on OS X 10.9.:

conda create -n test numpy python=2.7 --no-default-packages
source activate test
python -c 'import numpy'
Mike Müller
  • 82,630
  • 20
  • 166
  • 161
  • I didn't add that step in there but you can see that it's activated in the output '/Users/me/anaconda/envs/test/lib/python2.7/site-packages/numpy/lib/type_check.py' i'll update. – matt_k Dec 17 '15 at 21:46
  • Did you try opening a new shell window and work from there? – Mike Müller Dec 17 '15 at 22:51