爲了在mac中安裝pyglet,我遵循this link,因爲它是我發現的解決「錯誤的體系結構」問題的唯一資源。然而,當我執行最後一條命令pip install pyobjc==2.2
,它給了我下面的錯誤:在mac中安裝Pyglet
AttributeError: 'module' object has no attribute '_install_lib'
----------------------------------------
Cleaning up...
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__='/private/var/folders/Gb/Gbm1htNCGKeECJJNr2vUpk+++TQ/-Tmp-/pip_build_nueye/pyobjc-core/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/Gb/Gbm1htNCGKeECJJNr2vUpk+++TQ/-Tmp-/pip-6kYwdv-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/Gb/Gbm1htNCGKeECJJNr2vUpk+++TQ/-Tmp-/pip_build_nueye/pyobjc-core
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 11, in <module>
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 68: ordinal not in range(128)
我試圖執行the helloworld example from the pyglet programing guide反正,但是當我執行pyglet.app.run()
,該pyglet窗口凍結,不能顯示任何內容。
你知道爲什麼會發生這種情況嗎?有沒有另一種方式來安裝pyglet在mac?
我正在安裝pyobjc,因爲pyglet安裝被解釋的鏈接是這樣說的。 我會嘗試儘快使用32位python。謝謝您的回答! –
您的建議有效,謝謝! –