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
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.
On Tue, May 16, 2017 at 5:28 PM, Irv Kalb <[hidden email]> wrote:
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.
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?
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:/Python36I personally have it set up a little differently, with subversions for testing: I have e.g. "python27.exe", "python35.exe", etc..
mklink /D python3.exe python.exe
I don't know, but I suspect that these are UNIX-compatible commands, instead of Windows-.
I think it's a bit trivial (although for absolute newbies, I understand perhaps not), but I don't see any reason why not.
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.
Ideally, yes. Probably, you want to uninstall the 32-bit version first.
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.
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:
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.
In reply to this post by Ian Mallett-2
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
pip3 install pygame
It would have saved me a lot of time.
Thanks again very much,
On 17 May 2017 at 20:57, Irv Kalb <[hidden email]> wrote:
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!
Thank you for the very quick update!
This will certainly be helpful to people who are trying to install pygame.
In reply to this post by Irv Kalb
instructions in Windows section of GettingStarted should be updated to use py. https://www.pygame.org/wiki/
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.
py -m pygame.examples.aliens
brought up the game demo.
|Free forum by Nabble||Edit this page|