【问题标题】:after pip uninstall : pkg_resources.DistributionNotFound:pip卸载后:pkg_resources.DistributionNotFound:
【发布时间】:2014-09-10 14:43:29
【问题描述】:

使用 pip,我以可编辑模式安装脚本

pip install -e .

好的,然后用

卸载

pip 卸载我的脚本

好的,但是如果我尝试使用卸载的脚本,我会得到

pkg_resources.DistributionNotFound: myscript==0.0.1

为什么脚本没有被完全删除?

【问题讨论】:

标签: pip uninstallation setup.py


【解决方案1】:

我在 pip 存储库 pip uninstall does not properly cleanup bin scripts (for non-pip installs) 中找到了问题。

我通过更改 setup.py 解决了

--- a/setup.py
+++ b/setup.py
@@ -12 +12,5 @@ setup(
-    scripts=['bin/myscript'],
+    entry_points={
+        'console_scripts': [
+            'myscript=bin:main',
+        ],
+    },

以及脚本的名称

renamed:    bin/myscript -> bin/__init__.py

【讨论】:

    猜你喜欢
    • 2014-06-28
    • 1970-01-01
    • 2015-12-18
    • 2013-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-15
    • 2021-10-03
    相关资源
    最近更新 更多