How to update pip.

Anonim

How to update pip.

PIP - command line utility designed to work with PYPI components. If this program is installed on the computer, it greatly facilitates the process of installing various third-party libraries for the Python programming language. The periodically considered component is updated, its code is improved and innovations are added. Next, we consider the Utility Utility Procedure with two ways.

Update PIP for Python

The package management system will work correctly only when its stable version is used. Periodically program components change their form, as a result, it needs to be updated and PIP. Let's consider two different methods of installing a new assembly that will be the most suitable in certain situations.

Method 1: Loading the new version of Python

Pip is put on a PC with Python downloaded from the official site. Therefore, the simplest update option will be downloading the most fresh build Python. Before that, it is not necessary to delete old, you can put a new one or save files elsewhere. First, we recommend to make sure that the installation of the fresh version is necessary. To do this, make the following:

  1. Open the "Run" window by pressing the Win + R keys combination, enter the CMD and press ENTER.
  2. In the "Command Line" window, you need to enter what is listed below and click on ENTER:

    Python --Version.

  3. Find out the version of the installed Python

  4. You will display the current assembly of Python. If it is lower below (at the time of this writing, this is 3.7.0), it means that you can update.

The procedure for downloading and unpacking the new version is true:

Go to the official site python

  1. Go to the official Python website on the link above or through a search in any convenient browser.
  2. Select the "downloads" section.
  3. Transition to Python download from the official site

  4. Click on the appropriate button to go to the list of available files.
  5. Go to Python download list on the official website

  6. In the list, specify the assembly and revision you want to put on your computer.
  7. Select a suitable download on the official Python website

  8. The installer program applies to the archive, as an offline or online installer. Find the appropriate and click on its name.
  9. Select the type of installer on the official Python website

  10. Wait for download and run the file.
  11. Be sure to check the box near the "Add Python 3.7 that PATH" item. Thanks to this, the program will be automatically added to the list of system variables.
  12. Enable Adding Variables when installing Python

  13. Set the installation type "Customize Installation".
  14. Python custom installation

  15. Now you will see a list of all available components. Make sure the item «pip» is activated, then click on «Next».
  16. Install pip during Python installation

  17. Mark the necessary additional parameters and select the location of software components location.

    Additional Python installation options

    We advise to put Python to the root folder of the system partition on the hard drive.

  18. Python installation location

  19. Expect installation completion. During this process, do not close the installer window or restart the PC.
  20. Python installation is complete expectation

  21. You will be notified that the process completed successfully.
  22. Notice of Python is installed,

Now a team of PIP package management system of the same name will work correctly with all additional modules and libraries. After installation, you can proceed to the utility and interact with it.

Method 2: Manual update PIP

Sometimes the method with Python just update to obtain the latest version of the PIP is not suitable because of the uselessness of this procedure. In this case, we recommend that you download the package management component manually and then inject it into the program and move on to work. You will need to make a few manipulations:

Go to the download page for PIP

  1. Go to the official download page PIP the link above.
  2. Decide an appropriate version of the three proposed.
  3. Select the version of the package system PIP

  4. Navigate to source code by clicking on the inscription «get-pip.py».
  5. Go to the conservation of the package system PIP

  6. You will see a full source code package management systems. At any point, press the right mouse button and select "Save As ...".
  7. Save the package system PIP

  8. Specify a convenient location on your computer and save the data to. His name and type should be left unchanged.
  9. Selecting the location to save the packages PIP system

  10. Locate the file on your PC, click on it and select PTP "Properties".
  11. Packet file system properties PIP

  12. With the left mouse button, highlight "Location" and copy it by pressing Ctrl + C.
  13. Location packets PIP file system

  14. Start window "Run" hot keys Win + R, write to cmd and click "OK".
  15. In the window that opens, enter the cd command, and then paste the above path with a combination of Ctrl + V. Click on Enter.
  16. The transition to a storage package system PIP

  17. You will be in the directory where you saved the file. Now, it must be installed in Python. To do this, enter and activate the following command:

    python get-pip.py

    Install the package system PIP

  18. Will begin downloading and installation. During this procedure, do not close the window, do not type anything in it.
  19. Waiting for the completion of the PIP package system

  20. You will be notified of the completion of the installation, this also shows the displayed input field.
  21. End installation of PIP package system

This is completed on this process. You can safely use the utility, download additional modules and libraries. However, if errors occur when entering commands, we recommend that you make the following actions, and then go to the "command line" again and start installing PIP.

  1. The fact is that not always when unpacking, the python of different assemblies is adding system variables. This is most often with the inattention of users. To manually create this data, first go to the Start menu, where press the PCM to "Computer" and select "Properties".
  2. Windows 7 system properties

  3. Several sections will appear on the left. Go to "Advanced System Parameters".
  4. Advanced Windows 7 System Parameters

  5. In the "Advanced" tab, click on "environment variables ...".
  6. Add variable in windows 7

  7. Create a system variable.
  8. Add a system variable in Windows 7

  9. Specify it PythonPath name, enter the following line and click on OK.

    C: \ Python№ \ lib; C: \ Python№ \ DLLS; C: \ Python№ \ lib \ lib-tk; C: \ Other-Folder-on-the-path

    Enter the name and value of the variable in Windows 7

    Where C: - Section of the hard disk where the Python№ folder is located.

  10. Python№ - Directory of the program (the name varies depending on the installed version).

Now you can close all windows, restart the computer and proceed to re-execute the second update PIP package management system.

Alternative method for adding libraries

Not every user has to update PIP and use it built-in utility to add modules to Python. In addition, not all versions of the program work correctly with this system. Therefore, we propose to use an alternative method that does not require the pre-installation of additional components. You need to do the following:

  1. Go to the module loading site and download them as an archive.
  2. Example of downloading modules for Python

  3. Open the directory through any convenient archiver and unpack the contents to any empty folder on the PC.
  4. Open the Python Module Directory

  5. Move to unpacked files and find the setup.py there. Click on it right-click and select "Properties".
  6. Module Installation File Properties for Python

  7. Copy or remember its location.
  8. Location-module for Python

  9. Run the "command line" and via the CD function to the copied directory.
  10. Go to the location of the Python module file

  11. Enter the following command and activate it:

    Python setup.py Install

    Install modules for python

It remains only to wait for the installation of the installation, after which you can go to work with modules.

As you can see, the PIP update process is quite complicated, but everything will turn out if you follow the above instructions. If the PIP utility does not work or not updated, we offered an alternative method for installing libraries, which in most cases functions correctly.

Read more