0

When I try to import numpy, it gives an error message:

(Python 2.7 + Windows 7)

>>>import numpy as np

"NameError: global name 'ERR_DEFAULT2' is not defined"

I searched for a solution:

rm -rf ~/.local/lib/python2.7/site-packages/numpy*
python setup.py install --user

Does it mean I need to go to "C:\Python27\Lib\site-packages\numpy" and double click the "setup.py"? anyway I tried but still doesn't work.

halfer
  • 18,701
  • 13
  • 79
  • 158
Mark K
  • 6,967
  • 13
  • 41
  • 87

2 Answers2

1

It certainly seems like there is something wrong with your numpy install. The command you've posted would require you to have the numpy source downloaded, there is probably a simpler way.

Install pip and then install numpy by:

pip install numpy
Community
  • 1
  • 1
Tim B
  • 2,488
  • 1
  • 17
  • 24
  • thanks for the answer. you are right, the problem is in the installation of numpy. however pip install doesn't solve the problem. but your reply is very helpful leading to the solution. up+1. – Mark K Nov 27 '14 at 05:27
0

again a problem with library.

I tried manually removed the installed files&folders in: (anything visible with wording "numpy")

C:\Python27\Lib
C:\Python27\Lib\site-packages

And download again numpy installer and re-installed them it still doesn't work. It gave other error message.

finally, below worked out:

uninstalled the numpy from Windows=>Control Panel=>Programs and Features

then,

there's was a post guided to "Unofficial Windows Binaries for Python Extension Packages" on http://www.lfd.uci.edu/~gohlke/pythonlibs/. So I went there and downloaded the wanted below.

install it, and it works.

Mark K
  • 6,967
  • 13
  • 41
  • 87