Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104802 > unrolled thread

Interaction between pygame and python

Started by"Tyson" <ttyson@d3ce.org>
First post2016-03-13 17:52 -0400
Last post2016-03-15 10:12 +1100
Articles 6 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  Interaction between pygame and python "Tyson" <ttyson@d3ce.org> - 2016-03-13 17:52 -0400
    Re: Interaction between pygame and python Rick Johnson <rantingrickjohnson@gmail.com> - 2016-03-14 09:53 -0700
      Re: Interaction between pygame and python Terry Reedy <tjreedy@udel.edu> - 2016-03-14 13:46 -0400
      Re: Interaction between pygame and python Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-14 13:05 -0600
        Re: Interaction between pygame and python Rick Johnson <rantingrickjohnson@gmail.com> - 2016-03-14 15:58 -0700
          Re: Interaction between pygame and python Chris Angelico <rosuav@gmail.com> - 2016-03-15 10:12 +1100

#104802 — Interaction between pygame and python

From"Tyson" <ttyson@d3ce.org>
Date2016-03-13 17:52 -0400
SubjectInteraction between pygame and python
Message-ID<mailman.89.1457944111.12893.python-list@python.org>
I am having a lot of trouble getting python to find the pygame module; my
operating system is Windows 7.  Can you  offer any help?  . Should I
download pygame into the same folder as Python? . any ideas at all?

 

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900 32 bit
(Intel)] on win32

Type "copyright", "credits" or "license()" for more information.

>>> import pygame

Traceback (most recent call last):

  File "<pyshell#0>", line 1, in <module>

   import pygame

ImportError: No module named 'pygame'

>>> import pygame, sys

Traceback (most recent call last):

  File "<pyshell#1>", line 1, in <module>

    import pygame, sys

ImportError: No module named 'pygame'

>>> 

[toc] | [next] | [standalone]


#104839

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2016-03-14 09:53 -0700
Message-ID<4e99f4f0-c5d6-47ff-b263-87a3656d6d66@googlegroups.com>
In reply to#104802
On Monday, March 14, 2016 at 3:28:40 AM UTC-5, Tyson wrote:
> I am having a lot of trouble getting python to find the
> pygame module; my operating system is Windows 7.  Can you
> offer any help?  . Should I download pygame into the same
> folder as Python? . any ideas at all?

If you're new to Python, or even programming in general, i
would highly suggest that you download a pygame executable
installer, and not source code. 

Typically, the you'll want third party libraries, and that's
what pygame *IS*, a third party library, to be installed into
your "PythonXY/Lib/site-packagages" folder. 

If you download and run an installer, one that is
appropriate for your operating system and Python version,
everything will be taken care of for you.

Since you are using Python 3.5.1 on a windows box, you'll
want to download and install the executable named
"pygame-1.9.1-py3.1.msi". You can get it here:

  http://www.pygame.org/download.shtml

Also, have a look at this page for some helpful "getting
started" info:

  http://www.pygame.org/wiki/GettingStarted

After you run the installer, open up a fresh Python shell,
and try to import pygame again. If that import fails, come
back here and post the full traceback.

> Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48)
> [MSC v.1900 32 bit (Intel)] on win32
> 
> >>> import pygame
> 
> Traceback (most recent call last):
> 
>   File "<pyshell#0>", line 1, in <module>
> 
>    import pygame
> 
> ImportError: No module named 'pygame'
> 
> >>> import pygame, sys

Just FYI: importing the "sys" module won't help. If pygame
is not there, it's not there -- plain and simple. 

Now, it could be that you *DO* have pygame installed. but
Python cannot find it. But the best thing for you to do at
this time, is to uninstall any current versions of pygame,
and/or delete any files belonging to pygame from your
computer, and start fresh by running the installer.

[toc] | [prev] | [next] | [standalone]


#104848

FromTerry Reedy <tjreedy@udel.edu>
Date2016-03-14 13:46 -0400
Message-ID<mailman.123.1457977645.12893.python-list@python.org>
In reply to#104839
On 3/14/2016 12:53 PM, Rick Johnson wrote:

> Since you are using Python 3.5.1 on a windows box, you'll
> want to download and install the executable named
> "pygame-1.9.1-py3.1.msi". You can get it here:
>
>    http://www.pygame.org/download.shtml

Or get pygame-1.9.2a0-cp35-none-win32.whl from
http://www.lfd.uci.edu/~gohlke/pythonlibs/

Instructions on installing with pip are at the top of the page.

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#104855

FromIan Kelly <ian.g.kelly@gmail.com>
Date2016-03-14 13:05 -0600
Message-ID<mailman.126.1457982349.12893.python-list@python.org>
In reply to#104839
On Mon, Mar 14, 2016 at 10:53 AM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
> If you download and run an installer, one that is
> appropriate for your operating system and Python version,
> everything will be taken care of for you.
>
> Since you are using Python 3.5.1 on a windows box, you'll
> want to download and install the executable named
> "pygame-1.9.1-py3.1.msi". You can get it here:
>
>   http://www.pygame.org/download.shtml

Unfortunately that installer is not appropriate for the OP's Python
version. The downloads on the pygame site are horrifically
out-of-date.

[toc] | [prev] | [next] | [standalone]


#104873

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2016-03-14 15:58 -0700
Message-ID<9d79bb60-6ad7-4b9e-89bf-f4c927c67000@googlegroups.com>
In reply to#104855
On Monday, March 14, 2016 at 2:06:02 PM UTC-5, Ian wrote:
> On Mon, Mar 14, 2016 at 10:53 AM, Rick Johnson
> <rantingrickjohnson@gmail.com> wrote:
> > If you download and run an installer, one that is
> > appropriate for your operating system and Python version,
> > everything will be taken care of for you.
> >
> > Since you are using Python 3.5.1 on a windows box, you'll
> > want to download and install the executable named
> > "pygame-1.9.1-py3.1.msi". You can get it here:
> >
> >   http://www.pygame.org/download.shtml
> 
> Unfortunately that installer is not appropriate for the OP's Python
> version. The downloads on the pygame site are horrifically
> out-of-date.

Well no wonder he's having such hard time, if a Pythonista like myself can't get it right, heck, then who can?

[toc] | [prev] | [next] | [standalone]


#104874

FromChris Angelico <rosuav@gmail.com>
Date2016-03-15 10:12 +1100
Message-ID<mailman.136.1457997168.12893.python-list@python.org>
In reply to#104873
On Tue, Mar 15, 2016 at 9:58 AM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
> On Monday, March 14, 2016 at 2:06:02 PM UTC-5, Ian wrote:
>> On Mon, Mar 14, 2016 at 10:53 AM, Rick Johnson
>> <rantingrickjohnson@gmail.com> wrote:
>> > If you download and run an installer, one that is
>> > appropriate for your operating system and Python version,
>> > everything will be taken care of for you.
>> >
>> > Since you are using Python 3.5.1 on a windows box, you'll
>> > want to download and install the executable named
>> > "pygame-1.9.1-py3.1.msi". You can get it here:
>> >
>> >   http://www.pygame.org/download.shtml
>>
>> Unfortunately that installer is not appropriate for the OP's Python
>> version. The downloads on the pygame site are horrifically
>> out-of-date.
>
> Well no wonder he's having such hard time, if a Pythonista like myself can't get it right, heck, then who can?

Go where Terry recommended:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

This is where you should go for Python module binaries for Windows, if
you don't want to compile your own.

ChrisA

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web