我在Windows 7机器上安装了python 3.3。我可以从IDLE导入Bio,但不是numpy或skimage。我收到以下错误:
import numpy
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
import numpy
File "C:\Python33\lib\site-packages\numpy\__init__.py", line 168, in <module>
from . import add_newdocs
File "C:\Python33\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Python33\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Python33\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Python33\lib\site-packages\numpy\core\__init__.py", line 6, in <module>
from . import multiarray
ImportError: DLL load failed: %1 is not a valid Win32 application.
sys.path yeilds:
['', 'C:\\Python33\\Lib\\idlelib', 'C:\\Python33\\python33.zip', 'C:\\Python33\\DLLs', 'C:\\Python33\\lib', 'C:\\Python33', 'C:\\Python33\\lib\\site-packages']
当我直接使用python解释器,或通过命令行从桌面运行文件时,我可以导入numpy,但不能导入skimage或Bio。该错误仅表示无法找到该模块。这个sys.path产生:
['/cygdrive/c/Users/michael.alonge/Desktop', '/usr/lib/python27.zip', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-cygwin', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/site-packages/PIL', '/usr/lib/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
当我想调整我的系统变量时,我在用户变量下找到以下变量:
Variable Name: PATH
Value: C:\Python33\Lib;C:\Python33\Lib\site-packages;C:\Python33\Lib\idlelib;C:\Python33.zip;C:\Python33\DLLs;C:\Python33\Lib;C:\Python33
似乎与我的路径不一致,具体取决于我从哪里启动文件。出于某种原因,从桌面启动的文件正在尝试访问python 2.7。我已经下载了Bio,numpy和skimage并安装在C:Python33 / Lib / site-packages中。我希望能够从IDLE或文件本身访问所有模块。
谢谢