How to install PyGame on Python 3.4?

2020-01-25 10:59发布

So I have this little problem. When I try to install PyGame for Python 3.4 I download a .whl (wheel?) file and don't know how to use it. Some guys told me something about pip but don't know how to use/install it.

9条回答
老娘就宠你
2楼-- · 2020-01-25 11:39

The other answer doesn't work for me on Windows 10 Pro N x64.

What did work was installing the win32.whl instead of amd64. I put this in my Python3.4\Scripts folder where pip is and ran

pip install pygame-1.9.2a0-cp34-none-win32.whl

This should work for others using a similar configuration.

查看更多
ら.Afraid
3楼-- · 2020-01-25 11:39

In my experience, you need to make sure of two things: 1) Both Python and Pygame should be 32 bit - not either or both being 64 bit. 2) Both Python and Pygame should be compatible for the same version.

You may be able to get the 64 bit version to work, but not all packages have migrated to 64 bit and the small performance improvement isn't worth the frustration of trying to get it to work. I also found the latest 32 bit Pygame (as of Feb. 5th, 2016) seems to work well with 32 bit Python 3.4.4. I installed 32 bit python-3.4.4.msi on Windows 10 from my downloads folder to the folder C:\Python34. Within the Python34 folder, I created a folder called "Project Directory". In it, I placed "pygame-1.9.2a0-hg_ea3b3bb8714a.win32-py3.4.msi" which I think I got from https://bitbucket.org/pygame/pygame/downloads. Double-clicked on it. Worked the first time. I had also installed "Microsoft Visual Studio Community 2015 with Update 1." No idea if this helped solve the problem, but this MVSC package installs a lot of DLLs. It takes quite a while to get MVSC installed. But - I now have Pygame working on Windows 10.

查看更多
在下西门庆
4楼-- · 2020-01-25 11:49

You can install the wheel file for Python 3.4 here:

First you have to install the wheel package from pip then install Pygame.

pip install wheel

pip install pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl

Here's a video to help you install pip on Youtube.

查看更多
登录 后发表回答