无法导入PyOpenGL

时间:2013-09-13 14:45:22

标签: python python-2.7 python-import pyopengl

我正在尝试在我的mac上安装PyOpenGL模块。但当我运行pip install PyOpenGL PyOpenGL_accelerate时,我得到了:

    Requirement already satisfied (use --upgrade to upgrade):
 PyOpenGL in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyOpenGL-3.1.0a3-py2.7.egg
    Requirement already satisfied (use --upgrade to upgrade): 
PyOpenGL-accelerate in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyOpenGL_accelerate-3.1.0a3-py2.7-macosx-10.6-intel.egg
    Cleaning up...

因为没有错误,我很天真,我会认为已经安装了模块。但是当我尝试导入任何应该附带的东西时,比如

import OpenGL 
OpenGL.ERROR_ON_COPY = True 
from OpenGL.GL import *
from OpenGL.GLUT import *

无法找到。 当我尝试运行它时,我得到:

/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /Users/lego90511/Desktop/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/GLUT/gears.py
Traceback (most recent call last):
  File "/Users/lego90511/Desktop/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/GLUT/gears.py", line 7, in <module>
    import OpenGL 
ImportError: No module named OpenGL

.egg就是它应该的地方,但我找不到任何其他东西。那么它在哪里消失了,或者如果没有解压缩鸡蛋怎么去那个?

经过一番探索后,我试图解压缩.egg文件。我得到了

pip unzip /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyOpenGL-3.1.0a3-py2.7.egg
The module /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyOpenGL-3.1.0a3-py2.7.egg (in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyOpenGL-3.1.0a3-py2.7.egg) is not a zip file; cannot be unzipped
Storing complete log in /Users/lego90511/.pip/pip.log
那么什么是.egg文件?

0 个答案:

没有答案