Python Forum
[PyGame] Problem importing pygame / installing pygame
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Problem importing pygame / installing pygame
#1
import pygame
Error:
File "C:\Python34\lib\site-packages\pygame\__init__.py", line 95, in <module> from pygame.base import * ImportError: DLL load failed: %1 is not a valid Win32 application.
Uh? I'm using Windows Vista, Python 3.4.3 and PyGame 1.9.2 (i think designed for 3.2 but im not sure)
I installed it to the directory listed in the error. Should I move it somewhere else?
Reply
#2
What was your method of installation for pygame?

it might be a 32/64 bit issue. Whatever your python is, pygame must be also. However python doestn have to be whatever your OS is either.

You cna also
pip install pygame
or install pygame through
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
Recommended Tutorials:
Reply
#3
I got it from PyGame's website, the installer is named pygame-1.9.2a0.win32-py3.2.msi. I installed it, again, in the directory seen in the error. Also, for your pip install method, where should I enter it?
For your second alternate, what is a .whl file? Where would I put it? What would I open it with?
I am also using the AMD-64 version of Python 3.4.
EDIT: Now that I look over it, I think it is a 64/32 clash. I'll get another install.
Reply
#4
Sorry i was on a tablet before, and typing on a tablet sucks compared to keyboard.

Quote:pygame-1.9.2a0.win32-py3.2.msi
win32 means 32 bit, py3.2 means for python3.2 version.
Quote:I am also using the AMD-64 version of Python 3.4.

Your using 64 bit python3.4 but your installing a 32 bit pygame for python3.2

First of all uninstall that pygame as it is the wrong version and wrong bittype

secondly before doing wheels, you can simply try to type this in your OS command prompt exactly like...
pip install pygame
and try that first as pip is suppose to install the proper version for you.

If that fails...

To install a wheel
pip install wheel
Which is in the command prompt of your operating system. IF you install python correctly, it will know what pip is

from here
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
if you using
Quote:I am also using the AMD-64 version of Python 3.4.

then you need the one entitled
pygame‑1.9.3‑cp34‑cp34m‑win_amd64.whl

then do
pip install pygame‑1.9.3‑cp34‑cp34m‑win_amd64.whl
of if its in your downloads
pip install C:/Users/USERNAME/Downloads/pygame‑1.9.3‑cp34‑cp34m‑win_amd64.whl
or whatever the proper path to downloads is in windows
or for path
cd %HOMEPATH%
pip install /Downloads/pygame‑1.9.3‑cp34‑cp34m‑win_amd64.whl
Recommended Tutorials:
Reply
#5
It works now! Thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Pygame display problem video game Paul_Maillet 1 568 Feb-20-2024, 07:50 PM
Last Post: Bronjer
  Isometric game pygame Tiled howardberger 1 436 Jan-31-2024, 10:01 PM
Last Post: deanhystad
  Pygame in 90 Minutes - For Beginners syntax issues GoldenHarvey 6 2,323 Dec-18-2023, 10:11 AM
Last Post: KeeleyGreenfelder
  [PyGame] Cannot display anything inside pygame window the_gullwing 5 983 Dec-07-2023, 02:44 AM
Last Post: Benixon
  pygame, sprites, and rects menator01 12 1,651 Dec-07-2023, 02:37 AM
Last Post: Benixon
  pygame installation problems Gheryk 5 8,443 Nov-29-2023, 08:49 PM
Last Post: E_Mohamed
  Problem with pygame.event.clear qq12346 1 2,029 Oct-05-2023, 08:39 AM
Last Post: patriciainman
  [PyGame] Surface and rectangle in pygame Fabrizio_fg 6 2,146 May-27-2023, 09:15 AM
Last Post: Fabrizio_fg
  pygame double jump problem Yegor123 3 2,475 May-02-2023, 09:34 PM
Last Post: sudoku6
Question [PyGame] my pygame car wont move Erio85 1 1,026 Apr-24-2023, 04:52 PM
Last Post: Erio85

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020