1

I'm new to programming and I'm studying python. I have to install pygame and pip in order to continue the book I'm studying from but I can't seem to find an easy way to do it. I've tried to upgrade pip but I dont know exactly how to do it. I already tried by using the prompter but it says that it cant recognize it as a internal or external command. I have recently downloaded the python 3.6.5 version and I still have the python 3.5 version installed. Is there an easy way to do it?

Edit: Already tried to do this one:'pip' is not recognized as an internal or external command

and this one:How do I update pip itself from inside my virtual environment?

but couldnìt understand that much.

2 Answers2

0

Usually, you can do

easy_install pip
pip install pygame

As alternative you can just use Anaconda which already has pip set up and ready to roll.

Snow bunting
  • 1,049
  • 7
  • 27
0

You don't have to install pip, since it's installed by default.

If you're using Windows, enter py -3.6 -m pip install pygame in the command-line. This will install pygame specifically for Python version 3.6.

In other operating systems you can enter pip3 install pygame or python3 -m pip install pygame. OS X users often have trouble with the installation, but I can't help with that.

Check out pygame's getting started page.


The problem in this special case was that the "Scripts" directory which contains pip was not installed. The user was able to fix it by running the Python installer again and selecting "modify".

Afterwards you can also upgrade pip in this way python -m pip install --upgrade pip or in Windows py -m pip install --upgrade pip.

skrx
  • 18,183
  • 3
  • 28
  • 43
  • This is the result: C:\Users\domea\AppData\Local\Programs\Python\Python36\python.exe: No module named pip – Domenico Agosta Jun 09 '18 at 13:08
  • What did you enter? – skrx Jun 09 '18 at 13:09
  • @skrz this one: py -3.6 -m pip install pygame – Domenico Agosta Jun 09 '18 at 13:20
  • Try to enter the full path to pip `C:\Users\domea\AppData\Local\Programs\Python\Python36\Scripts\pip.exe install pygame`. Is `pip.exe` actually in your `Scripts` directory? – skrx Jun 09 '18 at 13:27
  • @skrz If I enter this: C:\Users\domea\AppData\Local\Programs\Python\Python36\Scripts\pip.exe install pygame This comes out: Impossible to find the path. I'm translating from italian. Sorry – Domenico Agosta Jun 09 '18 at 13:35
  • Okay, check if there's a `Scripts` directory in your Python36 directory and if it contains a `pip.exe` or `pip3.exe` file. BTW, does the Python 3.6 interpreter start correctly when you enter `py -3.6`? – skrx Jun 09 '18 at 13:44
  • @skrz There is but it is placed in an other folder called Tools. There's no pip.exe nor pip3.exe. If it can be useful I downloaded python 3.6 yesterday but I still have the 3.5 version – Domenico Agosta Jun 09 '18 at 13:53
  • "Tools\scripts" is a different directory. It looks like Python was not installed correctly, because there should be a "Scripts" directory inside of the "Python36" directory. You could try to reinstall Python 3.6 and make sure to click on this "Add Python 3.6 to PATH" checkbox that you can see here: https://docs.python.org/3/using/windows.html#installation-steps – skrx Jun 09 '18 at 14:12
  • @skrz I'll try it. Thanks a lot. Once I've done it do I just need to write: "import pygame" and I'm good? – Domenico Agosta Jun 09 '18 at 14:20
  • Yes, pygame should be installed if `import pygame` works and you don't get an `ImportError`. – skrx Jun 09 '18 at 14:26
  • 1
    @skrz Okay I'm gonna comment just in case somebody needs it in the future. I could do it by rerunning the .exe and I could chose an option where i can modify and upgrade it without uninstalling. Then after I checked the Scipts folder was there directly in the python36 folder I entered this: "py -3.6 -m pip install pygame" in the prompt. Then It just tells you what to do. In my case it had the 9.0.3 version so it told me to upgrade it by using this:"python -m pip install --upgrade pip" BUT you have to write it like this:"py -m pip install --upgrade pip". Done. pygame works now. Thanks a lot. – Domenico Agosta Jun 09 '18 at 14:44