Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 26th, 2012, 11:08 AM
ClarkyCat ClarkyCat is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Location: Essex, England
Posts: 4 ClarkyCat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 7 m 41 sec
Reputation Power: 0
Incredibly entry level question

Hello,

I have started looking into pygame and python recently and really think I would like to give it a go, but am falling at the very first hurdle.

I have installed both python and pygame but when I type
"import pygame, sys" as instructed by a tutorial I am following I get a message telling me there is no such module.

The various versions and compatibility issues are ridiculously confusing for me (I know that doesn't bode well). I have tried installing an earlier python (2.7) but the error message in red still happens, although its much longer now.

Could it be something to do with my computer not looking in the right place for pygame?

I have noticed that upon installation a folder has been created called "developer" and pygame resides inside there, as opposed to the Python 2.7 folder.

I am on OSX 10.6.8

Thanks.

Reply With Quote
  #2  
Old November 26th, 2012, 11:36 AM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,364 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 10 h 28 m 48 sec
Reputation Power: 383
You're trying to use a package that doesn't come with the standard python distribution. I don't consider that an "entry level" problem. OSX is Apple's unix?

Moving your pygame directory into the python library site packages directory might work. Hmm, I don't have a site packages directory. Never mind that.

You could modify your python path environment variable and start python something like this:

Code:
$ PYTHONPATH=/usr/xxx/yyyy/developer:$PYTHONPATH python


You could change your ~/.bashrc file (or whatever you use for a shell)
You could make an alias
Code:
$ alias PYTHON="PYTHONPATH=/usr/xxx/yyyy/developer:$PYTHONPATH python"
__________________
[code]Code tags[/code] are essential for python code!

Reply With Quote
  #3  
Old November 26th, 2012, 11:42 AM
ClarkyCat ClarkyCat is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Location: Essex, England
Posts: 4 ClarkyCat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 7 m 41 sec
Reputation Power: 0
Thats really weird then, because all the tutorials etc I have been looking at just start talking about using pygame/python like its no big deal at all. Not even mentioning that it's a pain in the *** to actually get to work.

I will give your method a go in a sec and see how I get on, thanks for the help.
Comments on this post
b49P23TIvg agrees: I could be a freak!

Reply With Quote
  #4  
Old November 26th, 2012, 12:53 PM
ClarkyCat ClarkyCat is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Location: Essex, England
Posts: 4 ClarkyCat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 7 m 41 sec
Reputation Power: 0
Bah, I am finding it hard to believe that they made the software this difficult to install. Are you sure theres no easy way to get python and pygame working together?

Reply With Quote
  #5  
Old November 26th, 2012, 01:13 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,364 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 10 h 28 m 48 sec
Reputation Power: 383
on my system pygame is installed in
Code:
$ locate pygame
/usr/include/python2.7/pygame
/usr/include/python2.7/pygame/bitmask.h
...
/usr/lib/pyshared/python2.7/pygame
/usr/lib/pyshared/python2.7/pygame/_arraysurfarray.so
...
/usr/lib/python2.7/dist-packages/pygame
/usr/lib/python2.7/dist-packages/pygame-1.9.1release.egg-info
/usr/lib/python2.7/dist-packages/pygame/LGPL
/usr/lib/python2.7/dist-packages/pygame/__init__.py
...
/usr/lib/python2.7/dist-packages/pygame/docs/__init__.py
...
/usr/lib/python2.7/dist-packages/pygame/docs/ref/camera.html
...
/usr/lib/python2.7/dist-packages/pygame/docs/tut/DisplayModes.html
...
/usr/lib/python2.7/dist-packages/pygame/examples/__init__.py
...
/usr/lib/python2.7/dist-packages/pygame/examples/__init__.pyc
...
/usr/lib/python2.7/dist-packages/pygame/examples/data/alien1.gif
...
/usr/lib/python2.7/dist-packages/pygame/examples/macosx/aliens_app_example
...
/usr/lib/python2.7/dist-packages/pygame/examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/keyedobjects.nib
/usr/lib/python2.7/dist-packages/pygame/gp2x/__init__.py
...
/usr/lib/python2.7/dist-packages/pygame/tests/__init__.py
...
/usr/lib/python2.7/dist-packages/pygame/tests/base_test.py
...
/usr/lib/python2.7/dist-packages/pygame/threads/__init__.pyc
/usr/share/bug/python-pygame
...
/usr/share/doc/python-pygame
...
many etceteras

Last edited by b49P23TIvg : November 26th, 2012 at 01:42 PM.

Reply With Quote
  #6  
Old November 26th, 2012, 01:33 PM
dwblas dwblas is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2009
Posts: 291 dwblas User rank is Corporal (100 - 500 Reputation Level)dwblas User rank is Corporal (100 - 500 Reputation Level)dwblas User rank is Corporal (100 - 500 Reputation Level)dwblas User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 18 h 33 m 54 sec
Reputation Power: 7
Install http://www.macports.org/ if you don't have it already. Then you can install with
sudo port install py27-game

Reply With Quote
  #7  
Old November 26th, 2012, 01:44 PM
ClarkyCat ClarkyCat is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Location: Essex, England
Posts: 4 ClarkyCat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 7 m 41 sec
Reputation Power: 0
Great, I installed that. Not sure exactly what the last part of your instruction means however, or what it even is! Can you elaborate slightly?

Thanks for your help.

Reply With Quote
  #8  
Old November 26th, 2012, 01:53 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,364 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 10 h 28 m 48 sec
Reputation Power: 383
Open a terminal window. (xterm, for example) Issue the command

sudo port install py27-game

If you don't know the secret root password you'll have to try something else.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Incredibly entry level question

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap