mauvais fonctionnement d'ubuntu18.04 ! python -m pip désinstaller pip

Lors de l'utilisation du système ros sur ubuntu18.04, une erreur se produit lors de l'installation de certains packages d'installation :

Command "python setup.py egg_info" failed with error code 1 in......

Certains articles trompeurs disent que la version pip est faible ! Dit d'utiliser la mauvaise manière suivante ! ! ! !

python -m pip install --upgrade pip

Après cela, le problème n'a pas été résolu et je signalerais une erreur lors d'autres installations de pip :

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. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.

Étant donné que ros-melodic dans ubuntu18.04 fonctionne sous python2, la version de python ne peut pas être modifiée. Je ne peux pas résoudre ce problème en mettant à jour la version python, je réfléchis juste à la façon de supprimer ce mauvais outil pip ! ! !

J'ai déjà essayé :

sudo apt-get remove python-pip

Pas du tout! ! !

Cette commande supprime l'outil pip avec de bonnes fonctions système ! ! ! Et après suppression, le pip de cet environnement de base peut toujours être utilisé et l'erreur existe toujours ! ! !

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. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.

Enfin, je l'ai modifié selon sa commande d'installation et désinstallé avec succès :

python -m pip uninstall pip

 Ce qui est intéressant, c'est que lorsque je l'ai désinstallé, je signalais toujours une erreur. . . Enfin, il a été désinstallé avec succès.

zn@zn:~/catkin_ws$ python -m pip uninstall pip
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. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Found existing installation: pip 20.3.4
Uninstalling pip-20.3.4:
  Would remove:
    /home/zn/.local/bin/pip
    /home/zn/.local/bin/pip2
    /home/zn/.local/bin/pip2.7
    /home/zn/.local/lib/python2.7/site-packages/pip-20.3.4.dist-info/*
    /home/zn/.local/lib/python2.7/site-packages/pip/*
Proceed (y/n)? y
  Successfully uninstalled pip-20.3.4

Maintenant, j'utilise pip et je ne signale plus d'erreurs

zn@zn:~/catkin_ws$ pip install numpy
Collecting numpy
  Using cached https://files.pythonhosted.org/packages/3a/5f/47e578b3ae79e2624e205445ab77a1848acdaa2929a00eeef6b16eaaeb20/numpy-1.16.6-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: numpy
Successfully installed numpy-1.16.6

Après cette leçon, vous devez être prudent lorsqu'il s'agit de régler le fonctionnement de l'outil pip.

Je suppose que tu aimes

Origine blog.csdn.net/wzfafabga/article/details/129464439
conseillé
Classement