How to import numpy

asked 2017-06-16 14:00:48 +0200

Tabetha gravatar image

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


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 15:20:21 +0200 )edit

The error actually says that YOU are in the wrong spot. You are probably standing in a directory where there actually is a "" 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 23:14:04 +0200 )edit