Обновить pip python через терминал

Installation#

If your Python environment does not have pip installed, there are 2 mechanisms to install pip supported directly by pip’s maintainers:

ensurepip #

Python comes with an ensurepip module [ 1 ] , which can install pip in a Python environment.

$ python -m ensurepip --upgrade
$ python -m ensurepip --upgrade

More details about how ensurepip works and how it can be used, is available in the standard library documentation.

get-pip.py #

This is a Python script that uses some bootstrapping logic to install pip.

  • Download the script, from https://bootstrap.pypa.io/get-pip.py.
  • Open a terminal/command prompt, cd to the folder containing the get-pip.py file and run:

More details about this script can be found in pypa/get-pip’s README.

Standalone zip application#

The zip application is currently experimental. We test that pip runs correctly in this form, but it is possible that there could be issues in some situations. We will accept bug reports in such cases, but for now the zip application should not be used in production environments.

In addition to installing pip in your environment, pip is available as a standalone zip application. This can be downloaded from https://bootstrap.pypa.io/pip/pip.pyz. There are also zip applications for specific pip versions, named pip-X.Y.Z.pyz .

The zip application can be run using any supported version of Python:

then the currently active Python interpreter will be used.

Alternative Methods#

Depending on how you installed Python, there might be other mechanisms available to you for installing pip such as using Linux package managers .

These mechanisms are provided by redistributors of pip, who may have modified pip to change its behaviour. This has been a frequent source of user confusion, since it causes a mismatch between documented behaviour in this documentation and how pip works after those modifications.

If you face issues when using Python and pip installed using these mechanisms, it is recommended to request for support from the relevant provider (eg: Linux distro community, cloud provider support channels, etc).

Upgrading pip #

Upgrade your pip by running:

$ python -m pip install --upgrade pip
$ python -m pip install --upgrade pip
C:> py -m pip install --upgrade pip

Compatibility#

The current version of pip works on:

pip is tested to work on the latest patch version of the Python interpreter, for each of the minor versions listed above. Previous patch versions are supported on a best effort approach.

Other operating systems and Python versions are not supported by pip’s maintainers.

Users who are on unsupported platforms should be aware that if they hit issues, they may have to resolve them for themselves. If they received pip from a source which provides support for their platform, they should request pip support from that source.

The ensurepip module was added to the Python standard library in Python 3.4.

Источник

How to upgrade your pip package to the latest version

Pip is a useful tool for managing and installing python packages. Here’s how to upgrade it on various operating systems.

BitLaunch

BitLaunch

How to upgrade your pip package to the latest version

Pip is the defacto tool for managing and installing your Python packages. It lets you install third-party software packages that are listed in the Python Package Index (PyPi), extending functionality for developers and allowing regular users to install certain applications written in Python.

Pip is usually bundled with Python and updates automatically, but you might want to manually upgrade and manage it. This is what we’ll be teaching you today. This process should work whether you’re using pip on Linux, Windows, or macOS.

Checking your pip version

The first thing you’ll probably want to do is check which pip version you have in the first place. You can then compare that to the latest published version to see whether you should upgrade. The command for this is thankfully very simple:

Your output should look something like this:

pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8) 

You can check what the latest pip version is here and decide whether to update accordingly. At the time of writing, the latest pip version is 22.0.4. Our server is on 20.0.2, so an upgrade is definitely in order.

How to upgrade pip

Upgrading pip is again very easy process. Just run the following:

python -m pip install --upgrade pip 

Bear in mind that this command will try to uninstall the current version and replace it with the new one.

Upgrading pip on Ubuntu

If you see the message Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr , it’s because you’re using Ubuntu. The Ubuntu version of pip has been modified to disallow upgrades via this method. Instead, you must use the Ubuntu packaging system.

sudo apt update sudo apt install pip 

Note the Ubuntu package probably won’t be up to date. If you do need the latest version, you can download get-pip.py and run it. However, it’s worth noting that running pip as the root user can cause broken permissions and conflicting behavior with the system package manager. You are generally better off using a virtual environment.

Here are the commands you need:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python3 get-pip.py 

How to downgrade pip

If you do find that you need to rollback your pip version due to bugs, incompatibilities, or any other reason, find the version number you want to roll back to and then run this command:

python -m pip install pip==your.version.number 

How to update Python packages with pip

Pip also allows you to manually update individual Python packages. We can use matplotlib as an example:

pip3 install --upgrade matplotlib 

That about covers it. Pip is a versatile and useful tool and know you should now understand it a little better.

If you like to do your development in the cloud, feel free to check out our high-speed, anonymous VPS servers.

How to add SSL to Nginx

How to add SSL to Nginx

SSL keeps your user’s information secure and helps your website rank on search engines. Here’s how to set it up on Nginx.

Introducing: Fast SSL setup with the BitLaunch LEMP app

Introducing: Fast SSL setup with the BitLaunch LEMP app

Add SSL to your Nginx server with a single command via the BitLaunch LEMP app.

Источник

Читайте также:  Material icon html code
Оцените статью