Python 3模块不起作用

时间:2016-09-10 18:09:18

标签: python python-3.x opencv opengl python-imaging-library

我最近尝试为Python 3.5安装Pillow。从命令行,from PIL import Image有效,但这对IDLE不起作用。当我安装Pillow时,它说已安装到C:\Users\arkj7\AppData\Local\Programs\Python\Python35-32\Lib\site-packages 当我尝试从Pillow导入Image时,它说,

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    from PIL import Image
  File "C:\Users\arkj7\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\PIL\Image.py", line 67, in <module>
    from PIL import _imaging as core
ImportError: cannot import name '_imaging'

但是当我运行import PIL时,它似乎有效。我正在运行Windows 10。

编辑:没有其他模块可以工作,他们会给出类似的错误消息。

第二次编辑:这只是越来越奇怪,当我尝试导入PyEnchant时,它可以从命令行运行,但不是IDLE。它给了我错误信息:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import enchant
  File "C:\Users\arkj7\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\enchant\__init__.py", line 92, in <module>
    from enchant import _enchant as _e
  File "C:\Users\arkj7\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\enchant\_enchant.py", line 102, in <module>
    raise WinError()
OSError: [WinError 193] <no description>

但是,像translate这样的模块工作正常。

编辑3:

除PIL,PyEnchant和OpenCV之外的所有模块都有效。 OpenCV可以从命令行运行,我在运行Python 3.5.2,但不运行IDLE,我也运行Python 3.5.2。我从here获得了OpenCV,并使用了opencv_python-3.1.0-cp35-cp35m-win32.whl。我使用pip install opencv_python-3.1.0-cp35-cp35m-win32.whl安装它,我从IDLE获得此错误消息:

>>> import cv2
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import cv2
ImportError: No module named 'cv2'

编辑4: 我像这样安装了PyOpenGL,pip install PyOpenGL PyOpenGL_accelerate。从命令提示符开始,有些东西可以正常运行,而其他东西也没有,这就是我得到的:

>>> import OpenGL
>>> from OpenGLContext import testingcontext
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'OpenGLContext'
>>> from OpenGL.GL import *

这是我从IDLE得到的:

>>> import OpenGL
>>> from OpenGLContext import testingcontext
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    from OpenGLContext import testingcontext
ImportError: No module named 'OpenGLContext'
>>> import OpenGLContext
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import OpenGLContext
ImportError: No module named 'OpenGLContext'
>>> from OpenGL.GL import *
OpenGL_accelerate seems to be installed, but unable to import error checking entry point!
Unable to load ArrayDatatype accelerator from OpenGL_accelerate
Unable to load converters accelerators (wrapper, arraydatatype) from OpenGL_accelerate
Unable to load arrayhelpers accelerator from OpenGL_accelerate
OpenGL_accelerate seems to be installed, but unable to import expected wrapper entry points!
Unable to load VBO accelerator from OpenGL_accelerate

0 个答案:

没有答案