Python 重新加载numpy模块时出现的问题
我使用的软件CellProfiler启动了自己的python,而不是我安装的python。 我们可以在软件中添加我们自己的模块,它们将在开始时加载。 这个python中的numpy版本是1.5,我需要使用numpy>=1.6的版本 我在此文件夹中有numpy的来源: E:\\Users\\Nicolas\\CellProfiler插件\\站点包\\numpy 我像这样在sys.path中添加路径Python 重新加载numpy模块时出现的问题,python,Python,我使用的软件CellProfiler启动了自己的python,而不是我安装的python。 我们可以在软件中添加我们自己的模块,它们将在开始时加载。 这个python中的numpy版本是1.5,我需要使用numpy>=1.6的版本 我在此文件夹中有numpy的来源: E:\\Users\\Nicolas\\CellProfiler插件\\站点包\\numpy 我像这样在sys.path中添加路径 import sys sys.path.insert(0, 'E:\\Users\\Nicolas\
import sys
sys.path.insert(0, 'E:\\Users\\Nicolas\\CellProfiler Plugin\\site-package')
我像这样进口numpy。但是他已经加载了,这是错误的版本。所以我重新装填
import numpy as np
np = reload(np)
但我有一个错误:
Traceback (most recent call last):
File "cellprofiler\modules\__init__.pyc", line 298, in add_module
File "E:\Users\Nicolas\CellProfiler Plugin\MyModule.py", line 17, in <module>
File "E:\Users\Nicolas\CellProfiler Plugin\site-package\numpy\__init__.py", line 128, in <module>
ImportError: cannot import name git_revision
我发现他没有在E:\Users\Nicolas\CellProfiler Plugin\site package\numpy\中加载version.py,而是在CellProfiler库中的以下位置获取该版本:
C:\Program Files\CellProfiler\library.zip\numpy
如何导入numpy 1.7
也许,换句话说,如何重新加载模块的所有依赖项
C:\Program Files\CellProfiler\library.zip\numpy