我是python的新手,我正试图在OSX上使用OpenGL运行一个小tuto。
所以我的脚本是这样的:
import pyglet
from pyglet.gl import *
win = pyglet.window.Window()
@win.event
def on_draw():
# Clear buffers
glClear(GL_COLOR_BUFFER_BIT)
# Draw some stuff
glBegin(GL_LINES)
glVertex2i(50, 50)
glVertex2i(75, 100)
glVertex2i(100, 150)
glVertex2i(200, 200)
glEnd()
pyglet.app.run()
我在 myenv 目录中创建了这样的virtualenv:
virtualenv --no-site-packages myenv
我开始使用这样的virtualenv:
source myenv/bin/activate
问题是,当我运行脚本时,我收到此错误:
dyld: Library not loaded: /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libclparser.dylib
Referenced from: /usr/local/bin/import
Reason: image not found
./helloWorld3D.py: line 2: 32482 Trace/BPT trap: 5 import pyglet
from: can't read /var/mail/pyglet.gl
./helloWorld3D.py: line 5: syntax error near unexpected token `('
./helloWorld3D.py: line 5: `win = pyglet.window.Window()'
但我之前在我的virtualenv中安装了'pylet'和'pip',就像那样:
sudo pip install pyglet
当我在virtualenv中输入'pip list'时,我得到:
pip (1.5.6)
pyglet (1.1.4)
setuptools (3.6)
wsgiref (0.1.2)
当我在virtualenv中输入'yolk -l'时,我得到:
PyRSS2Gen - 1.0.0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
Python - 2.7.5 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload)
Twisted - 12.2.0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
altgraph - 0.10.1 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
bdist-mpkg - 0.4.4 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
bonjour-py - 0.3 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
macholib - 1.5 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
matplotlib - 1.1.1 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
modulegraph - 0.10.1 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
numpy - 1.6.2 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
py2app - 0.7.1 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
pyOpenSSL - 0.13 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
pyobjc-core - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-AddressBook - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-AppleScriptKit - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-AppleScriptObjC - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-Automator - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-CFNetwork - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-Cocoa - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-Collaboration - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-CoreData - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-CoreLocation - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-CoreText - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-DictionaryServices - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-ExceptionHandling - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-FSEvents - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-InputMethodKit - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-InstallerPlugins - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-InstantMessage - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-InterfaceBuilderKit - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-LatentSemanticMapping - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-LaunchServices - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-Message - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-OpenDirectory - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-PreferencePanes - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-PubSub - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-QTKit - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-Quartz - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-ScreenSaver - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-ScriptingBridge - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-SearchKit - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-ServiceManagement - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-SyncServices - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-SystemConfiguration - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-WebKit - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
pyobjc-framework-XgridFoundation - 2.3.2a0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC)
python-dateutil - 1.5 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
pytz - 2012d - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
scipy - 0.11.0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
setuptools - 0.6c12dev-r88846 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
vboxapi - 1.0 - active
virtualenv - 1.11.6 - active
wsgiref - 0.1.2 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)
xattr - 0.6.4 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
yolk - 0.4.3 - active
zope.interface - 3.8.0 - active development (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python)
所以似乎PyGlet存在'Pip'而不是'yolk'.... 有人可以帮帮我吗?