ubuntu18.04错误操作!python -m pip uninstall pip
创始人
2024-06-01 13:11:48

在ubuntu18.04上操作ros系统,由于某些安装包安装时出现报错:

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

有些误人子弟的文章说是pip版本低问题!说要采用以下错误方式!!!!

python -m pip install --upgrade pip

之后问题没解决,我在进行其他的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.

由于ubuntu18.04中的ros-melodic是在python2下工作,python版本是不能动的。我不能通过升级python版本解决这个问题,我只想着怎么把这个错误的pip工具删掉!!!

我尝试过:

sudo apt-get remove python-pip

完全不行!!!

这句命令把我系统功能好的pip工具给移除了!!!而且在移除后这个基础环境的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.

最后我根据他的安装命令进行了修改,成功卸载:

python -m pip uninstall pip

 有趣的是我在卸载他时,还在报错。。。最后是成功卸载了。

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)? ySuccessfully uninstalled pip-20.3.4

现在我在用pip不再报错了

zn@zn:~/catkin_ws$ pip install numpy
Collecting numpyUsing 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

经过这次教训,涉及到调整pip工具的操作,要慎重。

相关内容

热门资讯

北京的名胜古迹 北京最著名的景... 北京从元代开始,逐渐走上帝国首都的道路,先是成为大辽朝五大首都之一的南京城,随着金灭辽,金代从海陵王...
苗族的传统节日 贵州苗族节日有... 【岜沙苗族芦笙节】岜沙,苗语叫“分送”,距从江县城7.5公里,是世界上最崇拜树木并以树为神的枪手部落...
长白山自助游攻略 吉林长白山游... 昨天介绍了西坡的景点详细请看链接:一个人的旅行,据说能看到长白山天池全凭运气,您的运气如何?今日介绍...
世界上最漂亮的人 世界上最漂亮... 此前在某网上,选出了全球265万颜值姣好的女性。从这些数量庞大的女性群体中,人们投票选出了心目中最美...