Installing Python 3 and pygame

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Installing Python 3 and pygame

Irv Kalb
One of the colleges where I teach has made a decision to move from Python 2 to Python 3.  To help the admin's, I was asked to give detailed instructions on how to install Python 3 and pygame.  The school has mostly Windows machines, so I thought I would try that out first.

I have to admit that I am a Mac guy and, I am NOT a command line guy, never used the command line on Windows.  (I have typically used high level Interactive Development Environments, and I use IDLE to teach Python).

I decided to test things out on my home computer, which is a Windows 7 system.  I had run Python 2 on it, so I removed that (using Remove Programs) before I started.  I read up on what to do, and here's what happened:

1) Install Python 3.  I went to Python.org, rolled over The Downloads tab, and clicked on Python 3.6.1.  That downloaded an exe for me.  When I went to run that exe, it said that this would install Python 3.6.1-32 bit version.  I had expected it to detect that I am running a 64 bit operating system, and install the 64 bit version of Python, but I installed the 32 bit version anyway.  I did check the "Add Python 3.6.1 to PATH?" checkbox on.

After installation, I was able to bring up IDLE, and run a simple Hello World program.

2) Install pygame.  I went to pygame.org, and attempted to follow the instructions there.  I went to Getting Started, then clicked on Installation.  The page there says "The best way to install pygame is with the pip tool (which is what Python uses to install packages.)  Note, this comes with python in recent versions.  We use the --user flag to tell it to install into the home directory, rather than globally. " 

Then in a box it shows:

python3 -m pip install pygame --user

I am not a Windows power user, and on behalf of my students who are mostly art students, who have never seen a command line, it is not clear what I am supposed to do here.  Since I have seen this type of thing before, I know that I have to type this into a command line.  But for a new user, just having a command there doesn't tell me anything.  I have Python3 installed, I have IDLE open - where am I supposed to type this???  

If I look farther down on the page, I see installation notes for Windows.  If I follow a link provided there to catcatcode.com, and read through it, I find that I must go to the Windows search bar and type "cmd".  This brings up the command line, where I can type my commands.  (While this probably seems trivial and obvious to people who have lots of experience writing software on Windows - to a novice or even a novice Windows user, this is not obvious at all.)  

OK, so now I can type my command.  Following the installation instructions, I type:

python3 - m pip install pygame --user

and I get back an error message that says:

'python3' is not recognized as an internal or external command,
operable program or batch file.

I'm lost.  I have no idea what to do about this error.  

Fortunately, I remember that there was a discussion of installations on this list, so, I look through fairly recent messages on this list to see what to do.  In one message from Rene Dudfield on May 11, he said:

Mainly we will try and point people to install with:
    pip3 install pygame

That seems to install correctly and I'm up and running.

However, even after getting things running, I go back to the command line and try to run the sample aliens game by typing the instructions given:

python3 -m pygame.examples.aliens

I get the same error about 'python3' is not a recognized as an internal, ...

So, I give up trying to run that sample program



Questions:

1)  What does the error message associated with the:  "python3 -m pip install pygame -- user "  mean?  Obviously it is not recognizing 'python3' - what do I do to fix that?  Is fixing that important if I don't intend to use the command line for development?

2)  Why do the instructions on the official pygame site tell users to use this command, which generates an error, when the "pip install pygame" or "pip3 install pygame" commands seem to do the job?

3)  (Suggestion) Perhaps the wording for Windows installations could be modified to include the extra step that tell users how to bring up the command line (for people like me and my students who might now have a clue about this).   The documentation for the Mac installation could also be modified to say that you need to bring up the terminal program to enter commands.

4)  Finally, is running Python 3.6.1 in 32 bit mode appropriate with pygame?  Since I have a 64 bit operating system, should I really go through the steps again and find and install the 64 bit version of python instead?  Why would default download default to a 32 bit version?  (I understand that these questions are out of the control of the pygame area, but I want to make sure that I have the correct environment, and that I tell my college how to get the correct environment for all the computers at the school.)

Sorry for the length of the post, but I expected that getting this environment set up would be a lot easier.  If my students were to face these problems trying to install it themselves, they would be completely lost and complain bitterly.

Irv
     


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Installing Python 3 and pygame

Ian Mallett-2
On Tue, May 16, 2017 at 5:28 PM, Irv Kalb <[hidden email]> wrote:
1)  What does the error message associated with the:  "python3 -m pip install pygame -- user "  mean?
​Exactly what it says. It's not recognized as a program. This means that it can't find "python3.exe", "python3.bat", or anything else named "python3" on your PATH.​
Obviously it is not recognizing 'python3' - what do I do to fix that?
​Since you clicked the add-to-path option in the installer, probably Python is already on your PATH. I think the issue is, on Windows, it's "python.exe", not "python3.exe". Does using "python" instead of "python3" work?
Is fixing that important if I don't intend to use the command line for development?
​Not really, no. If you want to "fix" it, you can make a symlink to the "python.exe" named "python3.exe", or something. Something like:
cd C:/Python36
mklink /D python3.exe python.exe
I personally have it set up a little differently, with subversions for testing: I have e.g. "python27.exe", "python35.exe", etc..
2)  Why do the instructions on the official pygame site tell users to use this command, which generates an error, when the "pip install pygame" or "pip3 install pygame" commands seem to do the job?
​I don't know, but I suspect that these are UNIX-compatible commands, instead of Windows-.

3)  (Suggestion) Perhaps the wording for Windows installations could be modified to include the extra step that tell users how to bring up the command line (for people like me and my students who might now have a clue about this).   The documentation for the Mac installation could also be modified to say that you need to bring up the terminal program to enter commands.
​I think it's a bit trivial (although for absolute newbies, I understand perhaps not), but I don't see any reason why not.​
 
4)  Finally, is running Python 3.6.1 in 32 bit mode appropriate with pygame?
​On a 64-bit OS, it's not ideal, but it's probably fine, so long as it works. The important thing to note is that the Python bitiness and the PyGame (or any other package) bitiness need to match, or you'll get cryptic errors at runtime.​
Since I have a 64 bit operating system, should I really go through the steps again and find and install the 64 bit version of python instead?
​Ideally, yes. Probably, you want to uninstall the 32-bit version first.
Why would default download default to a 32 bit version?  (I understand that these questions are out of the control of the pygame area, but I want to make sure that I have the correct environment, and that I tell my college how to get the correct environment for all the computers at the school.)
​Unsure. 32-bit will work on 64-bit (but not vice-versa), so it's a safer default in some sense. Still, 32-bit computers are pretty old today, and people who have them usually know about it. I'd make the user actively choose, without a default available—but it's sortof a UI question.
Sorry for the length of the post, but I expected that getting this environment set up would be a lot easier.  If my students were to face these problems trying to install it themselves, they would be completely lost and complain bitterly.

Irv
​Ian​
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Installing Python 3 and pygame

DiliupG
Even I have come across this kind of situation many times. Windos evolved from DOS to wht it is today so that people will NOT HAVE TO TYPE command line instructions for getting things done. Even Linux has gone in this direction to get a larger user base. If yanyone needs to leave the DOS commands in place fine, BUT in fairness to all the present the modern standard OS methods should implemented. I hope this will be looked at in the very near future.

On 17 May 2017 at 06:16, Ian Mallett <[hidden email]> wrote:
On Tue, May 16, 2017 at 5:28 PM, Irv Kalb <[hidden email]> wrote:
1)  What does the error message associated with the:  "python3 -m pip install pygame -- user "  mean?
​Exactly what it says. It's not recognized as a program. This means that it can't find "python3.exe", "python3.bat", or anything else named "python3" on your PATH.​
Obviously it is not recognizing 'python3' - what do I do to fix that?
​Since you clicked the add-to-path option in the installer, probably Python is already on your PATH. I think the issue is, on Windows, it's "python.exe", not "python3.exe". Does using "python" instead of "python3" work?
Is fixing that important if I don't intend to use the command line for development?
​Not really, no. If you want to "fix" it, you can make a symlink to the "python.exe" named "python3.exe", or something. Something like:
cd C:/Python36
mklink /D python3.exe python.exe
I personally have it set up a little differently, with subversions for testing: I have e.g. "python27.exe", "python35.exe", etc..
2)  Why do the instructions on the official pygame site tell users to use this command, which generates an error, when the "pip install pygame" or "pip3 install pygame" commands seem to do the job?
​I don't know, but I suspect that these are UNIX-compatible commands, instead of Windows-.

3)  (Suggestion) Perhaps the wording for Windows installations could be modified to include the extra step that tell users how to bring up the command line (for people like me and my students who might now have a clue about this).   The documentation for the Mac installation could also be modified to say that you need to bring up the terminal program to enter commands.
​I think it's a bit trivial (although for absolute newbies, I understand perhaps not), but I don't see any reason why not.​
 
4)  Finally, is running Python 3.6.1 in 32 bit mode appropriate with pygame?
​On a 64-bit OS, it's not ideal, but it's probably fine, so long as it works. The important thing to note is that the Python bitiness and the PyGame (or any other package) bitiness need to match, or you'll get cryptic errors at runtime.​
Since I have a 64 bit operating system, should I really go through the steps again and find and install the 64 bit version of python instead?
​Ideally, yes. Probably, you want to uninstall the 32-bit version first.
Why would default download default to a 32 bit version?  (I understand that these questions are out of the control of the pygame area, but I want to make sure that I have the correct environment, and that I tell my college how to get the correct environment for all the computers at the school.)
​Unsure. 32-bit will work on 64-bit (but not vice-versa), so it's a safer default in some sense. Still, 32-bit computers are pretty old today, and people who have them usually know about it. I'd make the user actively choose, without a default available—but it's sortof a UI question.
Sorry for the length of the post, but I expected that getting this environment set up would be a lot easier.  If my students were to face these problems trying to install it themselves, they would be completely lost and complain bitterly.

Irv
​Ian​
 



--
http://www.diliupg.com

**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are not the intended recipient or have received it in error, please delete it and all copies from your system and notify the sender immediately by return e-mail. Any unauthorized reading, reproducing, printing or further dissemination of this e-mail or its contents is strictly prohibited and may be unlawful. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions.
**********************************************************************************************

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Installing Python 3 and pygame

Irv Kalb
In reply to this post by Ian Mallett-2
Ian,

Thank you for your very clear and helpful answers.

I did de-install the 32-bit version of Python, and re-installed the 64 bit version.  After that, installing pygame went smoothly.

I don't want to bother getting the python3 command working - it's just not important to me.  But I would strongly suggest to whoever in is charge of that part of the pygame site, that they change the instructions to simply be:

pip install pygame

or

pip3 install pygame

It would have saved me a lot of time.

Thanks again very much,

Irv

On May 16, 2017, at 5:46 PM, Ian Mallett <[hidden email]> wrote:

On Tue, May 16, 2017 at 5:28 PM, Irv Kalb <[hidden email]> wrote:
1)  What does the error message associated with the:  "python3 -m pip install pygame -- user "  mean?
​Exactly what it says. It's not recognized as a program. This means that it can't find "python3.exe", "python3.bat", or anything else named "python3" on your PATH.​
Obviously it is not recognizing 'python3' - what do I do to fix that?
​Since you clicked the add-to-path option in the installer, probably Python is already on your PATH. I think the issue is, on Windows, it's "python.exe", not "python3.exe". Does using "python" instead of "python3" work?
Is fixing that important if I don't intend to use the command line for development?
​Not really, no. If you want to "fix" it, you can make a symlink to the "python.exe" named "python3.exe", or something. Something like:
cd C:/Python36
mklink /D python3.exe python.exe
I personally have it set up a little differently, with subversions for testing: I have e.g. "python27.exe", "python35.exe", etc..
2)  Why do the instructions on the official pygame site tell users to use this command, which generates an error, when the "pip install pygame" or "pip3 install pygame" commands seem to do the job?
​I don't know, but I suspect that these are UNIX-compatible commands, instead of Windows-.

3)  (Suggestion) Perhaps the wording for Windows installations could be modified to include the extra step that tell users how to bring up the command line (for people like me and my students who might now have a clue about this).   The documentation for the Mac installation could also be modified to say that you need to bring up the terminal program to enter commands.
​I think it's a bit trivial (although for absolute newbies, I understand perhaps not), but I don't see any reason why not.​
 
4)  Finally, is running Python 3.6.1 in 32 bit mode appropriate with pygame?
​On a 64-bit OS, it's not ideal, but it's probably fine, so long as it works. The important thing to note is that the Python bitiness and the PyGame (or any other package) bitiness need to match, or you'll get cryptic errors at runtime.​
Since I have a 64 bit operating system, should I really go through the steps again and find and install the 64 bit version of python instead?
​Ideally, yes. Probably, you want to uninstall the 32-bit version first.
Why would default download default to a 32 bit version?  (I understand that these questions are out of the control of the pygame area, but I want to make sure that I have the correct environment, and that I tell my college how to get the correct environment for all the computers at the school.)
​Unsure. 32-bit will work on 64-bit (but not vice-versa), so it's a safer default in some sense. Still, 32-bit computers are pretty old today, and people who have them usually know about it. I'd make the user actively choose, without a default available—but it's sortof a UI question.
Sorry for the length of the post, but I expected that getting this environment set up would be a lot easier.  If my students were to face these problems trying to install it themselves, they would be completely lost and complain bitterly.

Irv
​Ian​
 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Installing Python 3 and pygame

Thomas Kluyver
On 17 May 2017 at 20:57, Irv Kalb <[hidden email]> wrote:
 But I would strongly suggest to whoever in is charge of that part of the pygame site, that they change the instructions to simply be:

pip install pygame

or

pip3 install pygame

It would have saved me a lot of time.

I'm not in charge, but I've edited the 'Getting Started' wiki page to use more standard commands. Sorry that you had to spend time figuring it out!

Thomas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Installing Python 3 and pygame

Irv Kalb
Thank you for the very quick update!

This will certainly be helpful to people who are trying to install pygame.

Irv


On May 17, 2017, at 1:23 PM, Thomas Kluyver <[hidden email]> wrote:

On 17 May 2017 at 20:57, Irv Kalb <[hidden email]> wrote:
 But I would strongly suggest to whoever in is charge of that part of the pygame site, that they change the instructions to simply be:

pip install pygame

or

pip3 install pygame

It would have saved me a lot of time.

I'm not in charge, but I've edited the 'Getting Started' wiki page to use more standard commands. Sorry that you had to spend time figuring it out!

Thomas

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Installing Python 3 and pygame

René Dudfield
In reply to this post by Irv Kalb
Hi,

instructions in Windows section of GettingStarted should be updated to use py.  https://www.pygame.org/wiki/GettingStarted

With python3.6 installed, this is on PATH by default.

py -m pip install pygame
py -m pygame.examples.aliens

Does that work for you? Unfortunately there isn't yet a GUI package manager by default on windows.

best,


On Wed, May 17, 2017 at 1:28 AM, Irv Kalb <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Irv@furrypants.com&#39;);" target="_blank">Irv@...> wrote:
One of the colleges where I teach has made a decision to move from Python 2 to Python 3.  To help the admin's, I was asked to give detailed instructions on how to install Python 3 and pygame.  The school has mostly Windows machines, so I thought I would try that out first.

I have to admit that I am a Mac guy and, I am NOT a command line guy, never used the command line on Windows.  (I have typically used high level Interactive Development Environments, and I use IDLE to teach Python).

I decided to test things out on my home computer, which is a Windows 7 system.  I had run Python 2 on it, so I removed that (using Remove Programs) before I started.  I read up on what to do, and here's what happened:

1) Install Python 3.  I went to Python.org, rolled over The Downloads tab, and clicked on Python 3.6.1.  That downloaded an exe for me.  When I went to run that exe, it said that this would install Python 3.6.1-32 bit version.  I had expected it to detect that I am running a 64 bit operating system, and install the 64 bit version of Python, but I installed the 32 bit version anyway.  I did check the "Add Python 3.6.1 to PATH?" checkbox on.

After installation, I was able to bring up IDLE, and run a simple Hello World program.

2) Install pygame.  I went to pygame.org, and attempted to follow the instructions there.  I went to Getting Started, then clicked on Installation.  The page there says "The best way to install pygame is with the pip tool (which is what Python uses to install packages.)  Note, this comes with python in recent versions.  We use the --user flag to tell it to install into the home directory, rather than globally. " 

Then in a box it shows:

python3 -m pip install pygame --user

I am not a Windows power user, and on behalf of my students who are mostly art students, who have never seen a command line, it is not clear what I am supposed to do here.  Since I have seen this type of thing before, I know that I have to type this into a command line.  But for a new user, just having a command there doesn't tell me anything.  I have Python3 installed, I have IDLE open - where am I supposed to type this???  

If I look farther down on the page, I see installation notes for Windows.  If I follow a link provided there to catcatcode.com, and read through it, I find that I must go to the Windows search bar and type "cmd".  This brings up the command line, where I can type my commands.  (While this probably seems trivial and obvious to people who have lots of experience writing software on Windows - to a novice or even a novice Windows user, this is not obvious at all.)  

OK, so now I can type my command.  Following the installation instructions, I type:

python3 - m pip install pygame --user

and I get back an error message that says:

'python3' is not recognized as an internal or external command,
operable program or batch file.

I'm lost.  I have no idea what to do about this error.  

Fortunately, I remember that there was a discussion of installations on this list, so, I look through fairly recent messages on this list to see what to do.  In one message from Rene Dudfield on May 11, he said:

Mainly we will try and point people to install with:
    pip3 install pygame

That seems to install correctly and I'm up and running.

However, even after getting things running, I go back to the command line and try to run the sample aliens game by typing the instructions given:

python3 -m pygame.examples.aliens

I get the same error about 'python3' is not a recognized as an internal, ...

So, I give up trying to run that sample program



Questions:

1)  What does the error message associated with the:  "python3 -m pip install pygame -- user "  mean?  Obviously it is not recognizing 'python3' - what do I do to fix that?  Is fixing that important if I don't intend to use the command line for development?

2)  Why do the instructions on the official pygame site tell users to use this command, which generates an error, when the "pip install pygame" or "pip3 install pygame" commands seem to do the job?

3)  (Suggestion) Perhaps the wording for Windows installations could be modified to include the extra step that tell users how to bring up the command line (for people like me and my students who might now have a clue about this).   The documentation for the Mac installation could also be modified to say that you need to bring up the terminal program to enter commands.

4)  Finally, is running Python 3.6.1 in 32 bit mode appropriate with pygame?  Since I have a 64 bit operating system, should I really go through the steps again and find and install the 64 bit version of python instead?  Why would default download default to a 32 bit version?  (I understand that these questions are out of the control of the pygame area, but I want to make sure that I have the correct environment, and that I tell my college how to get the correct environment for all the computers at the school.)

Sorry for the length of the post, but I expected that getting this environment set up would be a lot easier.  If my students were to face these problems trying to install it themselves, they would be completely lost and complain bitterly.

Irv
     



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Installing Python 3 and pygame

Irv Kalb
Yes, the:

py -m pygame.examples.aliens

brought up the game demo.

Thanks,

Irv


On May 18, 2017, at 1:53 AM, René Dudfield <[hidden email]> wrote:

Hi,

instructions in Windows section of GettingStarted should be updated to use py.  https://www.pygame.org/wiki/GettingStarted

With python3.6 installed, this is on PATH by default.

py -m pip install pygame
py -m pygame.examples.aliens

Does that work for you? Unfortunately there isn't yet a GUI package manager by default on windows.

best,


On Wed, May 17, 2017 at 1:28 AM, Irv Kalb <<a href="javascript:_e(%7B%7D,'cvml','Irv@furrypants.com');" target="_blank" class="">Irv@...> wrote:
One of the colleges where I teach has made a decision to move from Python 2 to Python 3.  To help the admin's, I was asked to give detailed instructions on how to install Python 3 and pygame.  The school has mostly Windows machines, so I thought I would try that out first.

I have to admit that I am a Mac guy and, I am NOT a command line guy, never used the command line on Windows.  (I have typically used high level Interactive Development Environments, and I use IDLE to teach Python).

I decided to test things out on my home computer, which is a Windows 7 system.  I had run Python 2 on it, so I removed that (using Remove Programs) before I started.  I read up on what to do, and here's what happened:

1) Install Python 3.  I went to Python.org, rolled over The Downloads tab, and clicked on Python 3.6.1.  That downloaded an exe for me.  When I went to run that exe, it said that this would install Python 3.6.1-32 bit version.  I had expected it to detect that I am running a 64 bit operating system, and install the 64 bit version of Python, but I installed the 32 bit version anyway.  I did check the "Add Python 3.6.1 to PATH?" checkbox on.

After installation, I was able to bring up IDLE, and run a simple Hello World program.

2) Install pygame.  I went to pygame.org, and attempted to follow the instructions there.  I went to Getting Started, then clicked on Installation.  The page there says "The best way to install pygame is with the pip tool (which is what Python uses to install packages.)  Note, this comes with python in recent versions.  We use the --user flag to tell it to install into the home directory, rather than globally. " 

Then in a box it shows:

python3 -m pip install pygame --user

I am not a Windows power user, and on behalf of my students who are mostly art students, who have never seen a command line, it is not clear what I am supposed to do here.  Since I have seen this type of thing before, I know that I have to type this into a command line.  But for a new user, just having a command there doesn't tell me anything.  I have Python3 installed, I have IDLE open - where am I supposed to type this???  

If I look farther down on the page, I see installation notes for Windows.  If I follow a link provided there to catcatcode.com, and read through it, I find that I must go to the Windows search bar and type "cmd".  This brings up the command line, where I can type my commands.  (While this probably seems trivial and obvious to people who have lots of experience writing software on Windows - to a novice or even a novice Windows user, this is not obvious at all.)  

OK, so now I can type my command.  Following the installation instructions, I type:

python3 - m pip install pygame --user

and I get back an error message that says:

'python3' is not recognized as an internal or external command,
operable program or batch file.

I'm lost.  I have no idea what to do about this error.  

Fortunately, I remember that there was a discussion of installations on this list, so, I look through fairly recent messages on this list to see what to do.  In one message from Rene Dudfield on May 11, he said:

Mainly we will try and point people to install with:
    pip3 install pygame

That seems to install correctly and I'm up and running.

However, even after getting things running, I go back to the command line and try to run the sample aliens game by typing the instructions given:

python3 -m pygame.examples.aliens

I get the same error about 'python3' is not a recognized as an internal, ...

So, I give up trying to run that sample program



Questions:

1)  What does the error message associated with the:  "python3 -m pip install pygame -- user "  mean?  Obviously it is not recognizing 'python3' - what do I do to fix that?  Is fixing that important if I don't intend to use the command line for development?

2)  Why do the instructions on the official pygame site tell users to use this command, which generates an error, when the "pip install pygame" or "pip3 install pygame" commands seem to do the job?

3)  (Suggestion) Perhaps the wording for Windows installations could be modified to include the extra step that tell users how to bring up the command line (for people like me and my students who might now have a clue about this).   The documentation for the Mac installation could also be modified to say that you need to bring up the terminal program to enter commands.

4)  Finally, is running Python 3.6.1 in 32 bit mode appropriate with pygame?  Since I have a 64 bit operating system, should I really go through the steps again and find and install the 64 bit version of python instead?  Why would default download default to a 32 bit version?  (I understand that these questions are out of the control of the pygame area, but I want to make sure that I have the correct environment, and that I tell my college how to get the correct environment for all the computers at the school.)

Sorry for the length of the post, but I expected that getting this environment set up would be a lot easier.  If my students were to face these problems trying to install it themselves, they would be completely lost and complain bitterly.

Irv
     




Loading...