In the terminal on the MAC it gives an error when trying to download pip and then the library

I'm trying to install the pygame library, and as far as I know, provided that I have a third version of python on my computer, then pip is already there. But I ran into a problem that I can't download the library. To which I was advised to download pip, which I also could not. By total:

1.Copied the URL: https://bootstrap.pypa.io/get-pip.py

  1. Inserted it into the curl terminal https://bootstrap.pypa.io/get-pip.py > get-pip.py

  2. Introduced sudo python get-pip.py

  3. Reultat:

    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support WARNING: The directory '/Users/petr/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting pip Downloading pip-20.0.2-py2.py3-none-any.whl (1.4 MB) |████████████████████████████████| 1.4 MB 1.2 MB/s Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 19.0.3 Uninstalling pip-19.0.3: Successfully uninstalled pip-19.0.3 Successfully installed pip-20.0.2 Petr:~ petr$ sudo pip install DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support WARNING: The directory '/Users/petr/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. ERROR: You must give at least one requirement to install (see "pip help install")

Tell me how to be

Author: eri, 2020-02-12

2 answers

A couple of tips:

  • Specify, if possible, the maximum number of data about the PC, OS, etc., when you do not know what the problem is

  • Formalize the question in such a way that the respondent does not try to read it, but tries to answer it(I mean that the question is " easy to read")

You have a mac. This is a unix-like system. It is initially preinstalled with python, but in most of the older (approximately earlier than 2017) software still running python version 2

What should I do?

First, check if you already have python3 installed. To do this, run sudo -H python3 get-pip.py. If you get an error saying that the command does not exist, check if python3 is not set to PATH:

sudo find /usr -name "python3*"

If find didn't find the path to python3, set it with brew install python3

And then sudo -H python3 get-pip.py

If find found python3, then add the path to python to the environment variable PATH. How to do this is written, for example, here

 1
Author: Mr Morgan, 2020-06-12 12:52:24

Did not fit in the comment, I will write here.

@Petr_Anisimov Good night.
1. You need to update your version python from 2.7 to the latest version, as from January 1, 2020, it literally "Reached the end of its life" ))).
2. The error also reports that the folder /Users/petr/Library/Caches/pip does not belong to or is not writable by the current user. You need to check the rights to the folder.
3. You already have the pip 19.0.3 version installed. It can be successfully reinstalled, but I would recommend it delete it so that you do not have any problems in the future.
After you fix the first 2 errors, you can have pip reinstalled to the new version.

P.S. I also advise you to use the IDE for working with python, as one of the options - pyCharm and install all the necessary tools and libraries through it.

 0
Author: Denis640Kb, 2020-02-12 22:27:45