【问题标题】:Unable to uninstall with pip无法使用 pip 卸载
【发布时间】:2015-09-15 14:11:56
【问题描述】:

learnpythonthehardway 上进行练习 46 时,我遇到了卸载问题。

背景

我的包显示为:

├── bin
├── docs
├── HELLOWORLD
│   ├── helloworld.py
│   ├── __init__.py
├── setup.py
└── tests
    ├── HELLOWORLD_tests.py
    ├── __init__.py

我安装包的方式:

  • 运行python setup.py sdist 以创建tar.gzegg-info 文件
  • 使用pip install,指向上面的tar.gz进行安装。

至此,就安装成功了,如下:

  • 包裹显示在/urs/local/lib/python2.7/dist-packages
  • 包可用(可以导入并成功运行)

问题

但是,问题是我无法使用 pip uninstall HELLOWORLD 卸载它,因为它显示了这条消息 Can't uninstall 'helloworld'. No files were found to uninstall.

我错过了哪一步?

【问题讨论】:

  • 看来pip 要么将名称转换为小写,要么您像这样键入它。用大写字母命名你的 Python 模块不太好。
  • 我尝试了小写/大写,但仍然是相同的消息。
  • 当您使用pip list 时,helloworld 会出现吗?
  • 确实如此。另外,我尝试使用“helloworld”重新安装,而不是“HELLOWORLD”,同样的错误。

标签: python pip


【解决方案1】:

发现错误,是因为pip是通过apt-get安装的,所以版本过时了。

知道了,因为我遇到了与此相同的错误: Why is PIP raising an AssertionError on pip freeze?

我不得不将pip 更新为pip install -U pip,问题就解决了。

【讨论】:

    猜你喜欢
    • 2019-08-05
    • 1970-01-01
    • 2021-10-03
    • 2020-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-30
    • 1970-01-01
    相关资源
    最近更新 更多