pip卸载失败 Not uninstalling cryptography at /usr/lib/python3/dist-packages, outside environment /usrCa

问题:使用pip卸载cryptography 

xxx@xxx:~/aaa/bbb$ sudo pip uninstall cryptography
Found existing installation: cryptography 3.4.8
Not uninstalling cryptography at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'cryptography'. No files were found to uninstall.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

解决:

由于我安装的cryptography版本是3.4.8, 查看版本及信息:

xxx@xxx:~/aaa/bbb$ pip show cryptography
Name: cryptography
Version: 3.4.8
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
Author: The Python Cryptographic Authority and individual contributors
Author-email: cryptography-dev@python.org
License: BSD or Apache License, Version 2.0
Location: /usr/lib/python3/dist-packages
Requires:
Required-by:

所以删除/usr/lib/python3/dist-packages路径下对应的cryptography-3.4.8.egg-info/

xxx@xxx:/usr/lib/python3/dist-packages$ sudo rm -rf cryptography-3.4.8.egg-info/

然后再执行 sudo pip uninstall cryptography 就可以成功删除了

xxx@xxx:~/aaa/bbb$ sudo pip uninstall cryptography
WARNING: Skipping cryptography as it is not installed.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

xxx@xxx:~/aaa/bbb/tools$ pip show cryptography
WARNING: Package(s) not found: cryptography

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值