Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 重新加载numpy模块时出现的问题_Python - Fatal编程技术网

Python 重新加载numpy模块时出现的问题

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\

我使用的软件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\\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