Jump to content


Photo

Pygame


  • Please log in to reply
11 replies to this topic

#1 jlinux1

jlinux1

    New Member

  • Members
  • Pip
  • 1 posts

Posted 16 October 2014 - 11:01 AM

I have the following code from the book:
import pygame.mixer

sounds = pygame.mixer
sounds.init()

def wait_finish(channel):
while channel.get_busy():
pass

s1 - sounds.Sound("heartbeat.wav")
wait_finish(s1.play())
s2 - sounds.Sound("buzz.wav")
wait_finish(s2.play())
s3 - sounds.Sound("ohno.wav")
wait_finish(s3.play())
s4 - sounds.Sound("carhorn.wav")
wait_finish(s4.play())

I have gone back to the 32 bit version of Python 3.4.2 and I installed 1.9.2a of Pygame. When I run the code I receive this message:
Traceback (most recent call last):
File "E:\MyProjects\Python\GameShow\GameShowSounds.py", line 1, in <module>
import pygame
ImportError: No module named 'pygame'
>>>
I have looked ant the windows path contains: C:\PythonX\Lib\site-packages\pygame

I hope that some one can help me with this problem. I believe I did the correct install of Pygame, though I could not find anything under the instructions tab.

#2 #TM#

#TM#

    Active Member

  • Members
  • PipPipPip
  • 91 posts
  • Gender:Not Telling

Posted 18 October 2014 - 11:34 AM


Hi jlinux1,

For installing Pygame in Windows follow the below procedures.

1. Uninstall the Pygame version you have installed. make sure that u have Python 3.4 installed.

2. Go to the below link and download the "pygame‑1.9.2a0.win‑amd64‑py3.4.exe" if you have 64 bit version of windows 7 and Python; else download "pygame‑1.9.2a0.win32‑py3.4.exe" if you have 32 bit version of Python.

Link to download pygame

3. Install the version downloaded, enjoy!!

:) B)

Edited by #TM#, 18 October 2014 - 11:37 AM.


#3 Tanner G Seymour

Tanner G Seymour

    Active Member

  • Members
  • PipPip
  • 10 posts

Posted 21 April 2015 - 04:24 PM

When I try to download pygame it comes up as a WHL file and won't open. Any thought? Just doesn't seem like it wants to download.


Edited by Tanner G Seymour, 21 April 2015 - 04:25 PM.


#4 #TM#

#TM#

    Active Member

  • Members
  • PipPipPip
  • 91 posts
  • Gender:Not Telling

Posted 23 April 2015 - 12:25 AM

Hi Tanner,

 

1. Download the appropriate file according to your system and Python version.

 

2. Open the command prompt in administrator mode.

 

3. Navigate to your Python installation folder (for using pip). Usually it is in the C:\Python**\Scripts (replace ** according to your Python version.

 

4. Just use pip install location-of-wheel-file\file.whl

e.g., in my computer,i am using 32-bit Python-3.3 on windows.

C:\Python33\Scripts>pip install F:\Edu_soft\Python\aspell_python-1.13-cp33-none-win32.whl

smile.pngrolleyes.gif



#5 NicoR

NicoR

    New Member

  • Members
  • Pip
  • 4 posts

Posted 01 July 2015 - 11:05 AM

Hi #TM#,

 

I have 64bit Windows 7 with Python 3.4 installed at C:\Python34

So I downloaded
pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl
from http://www.lfd.uci.e...honlibs/#pygame

and saved it to C:\Python32\Scripts

 

After that I open cmd in administrator mode and navigate to C:\Python32\Scripts and type the command
pip install pygame-1.9.2a0-cp34-none-win_amd64.whl

However I get this error:

pygame-1.9.2a0-cp34-none-win_amd64.whl is not a supported wheel on this platform

Can you/someone please guide me as to what I'm doing wrong? I'm stuck

Thanks



#6 #TM#

#TM#

    Active Member

  • Members
  • PipPipPip
  • 91 posts
  • Gender:Not Telling

Posted 02 July 2015 - 10:29 AM

After that I open cmd in administrator mode and navigate to C:\Python32\Scripts and type the command

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

However I get this error:

pygame-1.9.2a0-cp34-none-win_amd64.whl is not a supported wheel on this platform

Hi You are 22 coolz, i didn't get your question; i think it's a typo or you misplaced your file and mis-running pip. tongue.png
I mean you downloaded "pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl" and saving and running pip from "C:\Python32\Scripts". why buddy!?

You should save and run pip from "C:\Python34\Scripts".
smile.png



#7 NicoR

NicoR

    New Member

  • Members
  • Pip
  • 4 posts

Posted 03 July 2015 - 03:12 AM

Hi You are 22 coolz, i didn't get your question; i think it's a typo or you misplaced your file and mis-running pip. tongue.png
I mean you downloaded "pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl" and saving and running pip from "C:\Python32\Scripts". why buddy!?

You should save and run pip from "C:\Python34\Scripts". smile.png

Sorry yes that was a typo only in my message above

But no typo while executing this command otherwise I wouldn't have entered a nonexistent folder

 

Yes I did save it in C:\Python34\Scripts

and run from there

yeZqV4Y.png

 

But I still get the error.

Any idea? I'm confused



#8 NicoR

NicoR

    New Member

  • Members
  • Pip
  • 4 posts

Posted 04 July 2015 - 07:09 PM

Umm now I think the python I'm using is 32 bit...:/
yXdLmwW.png

Please verify..

But I have a 64bit Windows 7 and I'm not sure why I installed 32 bit python 3.4.3

Now I can't find an .msi file for 32bit pygame for python version 3.4

Now what?



#9 #TM#

#TM#

    Active Member

  • Members
  • PipPipPip
  • 91 posts
  • Gender:Not Telling

Posted 05 July 2015 - 02:52 AM

Umm now I think the python I'm using is 32 bit...:/
yXdLmwW.png

Please verify..

But I have a 64bit Windows 7 and I'm not sure why I installed 32 bit python 3.4.3

Now I can't find an .msi file for 32bit pygame for python version 3.4

Now what?

OK, hmm..... there i see.

 

You are using 32 bit Python on a 64 bit windows (that's fine you can use it ); but trying to install a 64 bit wheel. Open the "Python3.4 commandline" from the start menu in windows and use the below line.

import distutils.util; print(distutils.util.get_platform())

if it prints "win32"; then you have installed python 32 bit version for sure. rolleyes.gif

 

https://www.python.o...ase/python-343/ here you can download x86_64 bit MSI installer version of Python for windows.

 

Better just download and use the "pygame‑1.9.2a0‑cp34‑none‑win32.whl" from http://www.lfd.uci.e...honlibs/#pygame and install it command line. cool.pngsmile.png


Edited by #TM#, 05 July 2015 - 02:53 AM.


#10 NicoR

NicoR

    New Member

  • Members
  • Pip
  • 4 posts

Posted 07 July 2015 - 12:37 AM

Thanks.

That totally worked!

Cheers!

OK, hmm..... there i see.

 

You are using 32 bit Python on a 64 bit windows (that's fine you can use it ); but trying to install a 64 bit wheel. Open the "Python3.4 commandline" from the start menu in windows and use the below line.

import distutils.util; print(distutils.util.get_platform())

if it prints "win32"; then you have installed python 32 bit version for sure. rolleyes.gif

 

https://www.python.o...ase/python-343/ here you can download x86_64 bit MSI installer version of Python for windows.

 

Better just download and use the "pygame‑1.9.2a0‑cp34‑none‑win32.whl" from http://www.lfd.uci.e...honlibs/#pygame and install it command line. cool.pngsmile.png



#11 #TM#

#TM#

    Active Member

  • Members
  • PipPipPip
  • 91 posts
  • Gender:Not Telling

Posted 12 July 2015 - 04:10 AM

Great !! You are welcome.smile.png



#12 #TM#

#TM#

    Active Member

  • Members
  • PipPipPip
  • 91 posts
  • Gender:Not Telling

Posted 12 July 2015 - 04:12 AM

Thanks.

That totally worked!

Cheers!

Great! You are Welcome! :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users