Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411273 Posts in 69323 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 02:02:08 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)[SOLVED] Pygame won't install
Pages: [1]
Print
Author Topic: [SOLVED] Pygame won't install  (Read 7147 times)
MaverickMode
Level 0
**


It's not a bug, it's a feature :) Ok it's a bug


View Profile
« on: August 10, 2015, 12:31:56 AM »

I downloaded Python 3.4.3 and it says it's 32bit. I downloaded pygame-1.9.1.win32-py3.1.msi.

I started Python and wrote import pygame which shouldn't return anything and then I was gonna write print pygame.ver which should return a line of the version of pygame installed.

Instead I get this:

Code:
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import pygame
ImportError: No module named 'pygame'

People keep saying how I should install a 32bit version but it says it's 32bit. I saw other people on youtube having the same issue.

(he keeps saying "go ahead", just ignore that lol)

Anyone with an answer?
« Last Edit: August 13, 2015, 11:57:56 AM by MaverickMode » Logged

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” – Brian W. Kernighan

"Small minds discuss people; Average minds discuss events; Great minds discuss ideas."
zleub
Level 0
**


View Profile WWW
« Reply #1 on: August 10, 2015, 02:50:56 AM »

Seems like pygame-1.9.1.win32-py3.1.msi is build for python 3.1 ?
Logged
Areku
Level 1
*


Well yeah.


View Profile
« Reply #2 on: August 10, 2015, 03:28:10 AM »

Well, alright. I stumbled across the same problem as you a year or so ago, so I think I can help.

You see, the problem with Pygame is, it's no longer maintained by its developer. The latest version was released in 2009 for python 2.7, quickly patched for python 3.1 and 3.2, then never touched again. Both Python and computers in general have come a long way since then.

Now, you pretty much have four options:

1- Pick a different engine! Pyglet is a viable python-based alternative, or maybe even Game Maker if you're starting out.

2- Downgrade to Python 3.2. This sounds a bit counterintuitive, but some times you gotta do what you gotta do. Most of the changes from 3.3 to 3.5 have little impact on the making of a simple 2d game.

3- Update Pygame manually and recompile it. Although, even if it *is* open source, I find the inner pygame workings very messy to fiddle with, so this isn't really viable unless you have a lot of time on your hands.

4- Find an unofficial patched version. Chris Gohlke made the most famous one, but it's in .WHL format, so you'd need to extract it with Pip.

Hope this helps!
Logged
MaverickMode
Level 0
**


It's not a bug, it's a feature :) Ok it's a bug


View Profile
« Reply #3 on: August 10, 2015, 04:36:06 AM »

Seems like pygame-1.9.1.win32-py3.1.msi is build for python 3.1 ?

Yes but I tried other versions as well and same error. Thank you for the reply.

Well, alright. I stumbled across the same problem as you a year or so ago, so I think I can help.

You see, the problem with Pygame is, it's no longer maintained by its developer. The latest version was released in 2009 for python 2.7, quickly patched for python 3.1 and 3.2, then never touched again. Both Python and computers in general have come a long way since then.

Now, you pretty much have four options:

1- Pick a different engine! Pyglet is a viable python-based alternative, or maybe even Game Maker if you're starting out.

2- Downgrade to Python 3.2. This sounds a bit counterintuitive, but some times you gotta do what you gotta do. Most of the changes from 3.3 to 3.5 have little impact on the making of a simple 2d game.

3- Update Pygame manually and recompile it. Although, even if it *is* open source, I find the inner pygame workings very messy to fiddle with, so this isn't really viable unless you have a lot of time on your hands.

4- Find an unofficial patched version. Chris Gohlke made the most famous one, but it's in .WHL format, so you'd need to extract it with Pip.

Hope this helps!

1) Then I will definitely change the engine! I prefer using something less amateur and just use Pygelt instead of GameMaker (Layl said he wouldn't use this engine and I trust he knows what he's talking about. He didn't say it's bad but he preferred Unity)

2) Sometimes I wonder if using an earlier version is really downgrading when it comes to python... I read on it and apparently a lot of people still use python2 rather than python3. Python2 is just more compatible with everything whereas Python3 has so many more options although slightly worse library support (why?). At this stage I don't think it would make a real difference if I use Python 2 or 3 other than avoiding a headache like the one that started this thread lol. It won't make a production difference because of my level. In fact I think it's better to experience 2 before I jump into 3.

3) As for updating Pygame manually... I am an amateur when it comes to programming and advanced computer tasks, I wouldn't know where to start doing it. A guide maybe?

4) I will check out Chris Gohlke's patched version for sure, thank you so much for the resources! So people just use his version over the official ones?


Thanks a lot for the amazing reply!
Logged

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” – Brian W. Kernighan

"Small minds discuss people; Average minds discuss events; Great minds discuss ideas."
Schilcote
Level 1
*


View Profile
« Reply #4 on: August 10, 2015, 11:00:51 AM »

What? Pygame is maintained just fine. Just the website isn't.

Get the 3.4 installer from here.

People still use 2.7 either because they have massive amounts of legacy code that it would be too difficult to update or, more commonly, because they're stubborn and dumb. The "but my libraries don't have 3.x versions" argument doesn't really hold water anymore; the vast majority of stuff has 3 support. Python 3 is significantly better and you're doing yourself a disservice by downgrading to 2.7.
Logged
MaverickMode
Level 0
**


It's not a bug, it's a feature :) Ok it's a bug


View Profile
« Reply #5 on: August 10, 2015, 12:10:18 PM »

What? Pygame is maintained just fine. Just the website isn't.

Get the 3.4 installer from here.

People still use 2.7 either because they have massive amounts of legacy code that it would be too difficult to update or, more commonly, because they're stubborn and dumb. The "but my libraries don't have 3.x versions" argument doesn't really hold water anymore; the vast majority of stuff has 3 support. Python 3 is significantly better and you're doing yourself a disservice by downgrading to 2.7.

I keep getting surprises lol. I will try this too. Thank you!
Good explanation, I will stick to Python3.

Thank you, Schilcote.
Logged

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” – Brian W. Kernighan

"Small minds discuss people; Average minds discuss events; Great minds discuss ideas."
Areku
Level 1
*


Well yeah.


View Profile
« Reply #6 on: August 10, 2015, 12:34:56 PM »

What? Pygame is maintained just fine. Just the website isn't.

Get the 3.4 installer from here.



I...

I might need to reevaluate quite a few of my life choices, then.  Tired

Thanks for the info, though!
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #7 on: September 10, 2015, 10:29:58 PM »

doesn't work for me, installed python 64bit (necessary)
Logged

Schilcote
Level 1
*


View Profile
« Reply #8 on: September 11, 2015, 01:08:15 AM »

I don't think there's any 64-bit builds of Pygame.
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #9 on: September 11, 2015, 10:04:40 AM »

yes there is I just did it!
https://www.webucator.com/blog/2015/03/installing-the-windows-64-bit-version-of-pygame/
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic