When I try to import the scipy module (version 0.11.0b1) in the Python interpreter (version 2.6.1), I receive the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in module
File "/Users/...long path.../Desktop/scipy-0.11.0b1/scipy/\__init__.py", line 114, in module
ImportError: Error importing scipy: you cannot import scipy while
being in scipy source directory; please exit the scipy source
tree first, and relaunch your python intepreter.
The problem is that python is reading from a file that doesn’t exist. I deleted the scipy directory from my Desktop a while ago and have since tried restarting the interpreter (and the computer) several times. Why does the traceback continue to refer to a file that doesn’t exist?
It looks like the python path is including a reference to the directory you deleted.
If you:
You should be able to see a reference in there to the deleted directory. If that’s the case, removing that entry from sys.path will allow you to import scipy as before.
The tricky part may be finding where that path is being injected into sys.path. Possible locations include (but aren’t limited to): your system’s site.py file, the
PYTHONPATHenvironment variable, or even your O/SPATHenvironment variable.Best of luck!