且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python:import scipy导致引用已删除文件的回溯

更新时间:2022-05-23 08:04:53

似乎python路径包含对已删除目录的引用.

It looks like the python path is including a reference to the directory you deleted.

如果您:

import sys
print sys.path

您应该能够在其中看到对已删除目录的引用.在这种情况下,从sys.path中删除该条目将使您能够像以前一样导入scipy.

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.

棘手的部分可能是找到将该路径注入sys.path的 where .可能的位置包括(但不限于):系统的site.py文件,PYTHONPATH环境变量,甚至O/S PATH环境变量.

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 PYTHONPATH environment variable, or even your O/S PATH environment variable.

祝你好运!