下载PyGame for Python 3.4
我希望在Python3.4上安装PyGame。到目前为止,我已经下载了: pygame‑1.9.3‑cp27‑cp27m‑win_amd64.whl 从 我使用WingIDE来实现这一点,不确定它们是否重要。当我输入“导入pygame”时,我没有错误。只有当我输入pygame.init()时,我才会得到以下错误下载PyGame for Python 3.4,python,pygame,Python,Pygame,我希望在Python3.4上安装PyGame。到目前为止,我已经下载了: pygame‑1.9.3‑cp27‑cp27m‑win_amd64.whl 从 我使用WingIDE来实现这一点,不确定它们是否重要。当我输入“导入pygame”时,我没有错误。只有当我输入pygame.init()时,我才会得到以下错误 File "C:/Users/mount_000/Desktop/CS116/pygame-banans.py", line 3, in <module> pyg
File "C:/Users/mount_000/Desktop/CS116/pygame-banans.py", line 3, in <module>
pygame.init()
builtins.AttributeError: module 'pygame' has no attribute 'init'
文件“C:/Users/mount_000/Desktop/CS116/pygame banans.py”,第3行,在
pygame.init()
builtins.AttributeError:模块“pygame”没有属性“init”
我读过一些关于提取文件的文章,但不确定具体是如何提取的
提前感谢也许您已经用Python 2.7安装了PyGame pygame‑1.9.3‑cp27‑cp27m‑win_amd64.whl 使用Python 3.4安装它 在Python2.7上,尝试
Python 2.7.13 (default, Apr 4 2017, 08:47:57)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
>>> pygame.init()
2017-07-24 09:52:53.759 Python[1067:10041] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/7s/d087_7dx48n6mdl1ry4hw1s40000gn/T/org.python.python.savedState
(6, 0)
也许你用Python 2.7安装了PyGame pygame‑1.9.3‑cp27‑cp27m‑win_amd64.whl 使用Python 3.4安装它 在Python2.7上,尝试
Python 2.7.13 (default, Apr 4 2017, 08:47:57)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
>>> pygame.init()
2017-07-24 09:52:53.759 Python[1067:10041] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/7s/d087_7dx48n6mdl1ry4hw1s40000gn/T/org.python.python.savedState
(6, 0)
我希望在Python3.4上安装PyGame。到目前为止我有
下载:
pygame‑1.9.3‑cp27‑cp27m‑win_amd64.whl
问题是,您的Python版本是3.4,但您下载了cp27版本.whl
文件。“cp27”仅用于Python2.7
你需要下载
pygame‑1.9.3‑cp34‑cp34m‑win32.whl
或
pygame‑1.9.3‑cp34‑cp34m‑win_amd64.whl
我希望在Python3.4上安装PyGame。到目前为止我有
下载:
pygame‑1.9.3‑cp27‑cp27m‑win_amd64.whl
问题是,您的Python版本是3.4,但您下载了cp27版本.whl
文件。“cp27”仅用于Python2.7
你需要下载
pygame‑1.9.3‑cp34‑cp34m‑win32.whl
或
pygame‑1.9.3‑cp34‑cp34m‑win_amd64.whl
那是错误的pygame版本。您需要
cp34
版本,Python和pygame的位必须匹配(64位pygame用于64位Python)。您知道如何使用Windows命令行吗?您可以在命令行中输入py-3.4-m pip install pygame
(这将从PyPI下载pygame并专门为Python 3.4安装它)。您使用这个旧Python版本有什么原因吗?Pygame也适用于Python3.6。这是错误的Pygame版本。您需要cp34
版本,Python和pygame的位必须匹配(64位pygame用于64位Python)。您知道如何使用Windows命令行吗?您可以在命令行中输入py-3.4-m pip install pygame
(这将从PyPI下载pygame并专门为Python 3.4安装它)。您使用这个旧Python版本有什么原因吗?Pygame也适用于Python 3.6。