How to import numpy

asked 2017-06-16 07:00:48 -0600

I am having problems importing numpy. I have sage 7.6 and am using terminal sessions on mac. Whenever I try "import numpy" I get an error message saying "Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there." I understand that this means some numpy software is not in the right file, but others, working on the same project as me, I know have not had to import any extra software for numpy to work. I'd really appreciate any help!

edit retag flag offensive close merge delete

Comments

Can you give more detail as to exactly which version you have etc? Do you have other installations of some Python (other than the usual system one) like from Conda? This should work fine.

kcrisman gravatar imagekcrisman ( 2017-06-16 08:20:21 -0600 )edit

The error actually says that YOU are in the wrong spot. You are probably standing in a directory where there actually is a "numpy.py" present. If you make sure you're standing in a location where you get something like this:

$ ls numpy*
ls: cannot access 'numpy*': No such file or directory

things might work better.

nbruin gravatar imagenbruin ( 2017-06-16 16:14:04 -0600 )edit