ubuntu18.04错误操作!python -m pip uninstall pip

在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)? y
  Successfully uninstalled pip-20.3.4

现在我在用pip不再报错了

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

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值