0
votes

I've succesfully installed Python version 3.8.1 and also PIP.

After that i want to install Pygame and Pygame Zero with the commands pip install pygame or pip install pgzero

But I get the following error:

C:>pip install pygame Traceback (most recent call last): File "c:\program files\python38\lib\runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\program files\python38\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Program Files\Python38\Scripts\pip.exe__main__.py", line 9, in TypeError: 'module' object is not callable

Also with the --user command it doesn't succeed: pip install pygame --user or pip install pgzero --user

What am I doing w

4
Could you try py -3 -m pip install pygame and report back ? - han solo

4 Answers

1
votes

I also got that problem long ago.

You can try this:

pip uninstall pygame
pip uninstall pgzrun

then download it by:

pip install pygame
pip install pgzrun
0
votes

Info of your assets are little low.. But if you have Python 2 and 3, try manage your alias on CMD by checking your current python variables from /usr/bin and from CMD type "python --version" to see current default. If it says Python2.7 you can chance that with "alias" command below (reason to do that, is 2.7 support is ending 1.1.2020 and old pip for it too. So in future, you should upload new modules just for Python3.7). If you have 2.7 in your PC and you have been using it for some time, you should not try to remove it.

So just in case: $ alias python="/usr/bin/python3.7"

Then use command

$ sudo pip3 install pygame

This should work. If not, there is some setting problems on your module site.

Give a hit with this and if it doesn't work, let us know. I can give instruction to get it to work. It requires few steps at (in my case:)

/home/usr/Python-3.7.4/Modules/Settings.

It can (I'm not sure with these modules but..) require to set SSL connection too, but it can be done from there too, without any coding.

0
votes

Thank you for the quick arswers! It is succeeded by giving the commands: py -3 -m pip install pygame --user py -3 -m pip install pgzero --user

The only warnings i got by installing pgzero were:

Collecting pgzero Downloading ..... Installing collected packages: numpy, pgzero WARNING: The script f2py.exe is installed in 'C:\Users\Han\AppData\Roaming\Python\Python38\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script pgzrun.exe is installed in 'C:\Users\Han\AppData\Roaming\Python\Python38\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed numpy-1.18.0 pgzero-1.2

0
votes

Oh.. I didn't know, you are using Windows.. My last answer dried down with that. It was for Linux. Either way, when you installed python, did you mark the PATH in installation process? It shows when installation windows pops up. I'm little noob with windows, but I expect it to be as same as in any operation systems. If you didn't, its easier to remove Python and install it again, than try to mark the PATH after installing. After all its just 1/2 min job.