2

我正在尝试在我的 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 文件是什么?

4

0 回答 0