本文介绍了在Mac中安装Pyglet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已遵循此链接为了在Mac中安装pyglet,因为这是我发现的解决错误体系结构"问题的唯一资源.但是,当我执行最后一个命令pip install pyobjc==2.2时,它给了我以下错误:

I have followed this link in order to install pyglet in mac, because it is the only resource I have found that solves the "wrong architecture" problem. However, when I execute the last commmand pip install pyobjc==2.2, it gives me the following error:

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)

我一直试图执行pyglet编程指南中的 helloworld示例 ,但是当我执行pyglet.app.run()时,pyglet窗口冻结,并且不显示任何内容.

I have tried to execute the helloworld example from the pyglet programing guide anyway, but when I execute pyglet.app.run(), the pyglet window freezes and does not display anything.

您知道为什么会这样吗?还有另一种在Mac中安装pyglet的方法吗?

Do you have any idea why this is happening? Is there another way to install pyglet in mac?

推荐答案

我不理解pyobjc安装的重点?

I don't understand the point of your pyobjc install ?

在osX上Pyglet的问题是64位体系结构,因此只需尝试在控制台中键入以下内容来强制python变为32位:

The issue with Pyglet on osX is 64-bit architecture, so just try this to force python to go 32bit by typing this in your console:

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

这篇关于在Mac中安装Pyglet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 01:45