简体   繁体   English

如何“pipenv 卸载”从 web 上的存档文件安装的 package?

[英]How to `pipenv uninstall` a package installed from an archive file on the web?

I started to use pipenv a few days ago.几天前我开始使用 pipenv。 I have installed a 2.0.0 version of a library, I did:我已经安装了一个 2.0.0 版本的库,我做了:

pipenv intall https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz#egg=es_core_news_sm

Then I realized I need a 2.3.0 version, so I did然后我意识到我需要一个 2.3.0 版本,所以我做了

pip install https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.3.0/es_core_news_sm-2.3.0.tar.gz#egg=es_core_news_sm

And I would like to remove the previous one (2.0.0), so:我想删除前一个(2.0.0),所以:

pipenv uninstall https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz
Un-installing https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz…

No package https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz to remove from Pipfile.
Locking [dev-packages] dependencies…
Locking [packages] dependencies…

So it looks like pipenv did not remove the first version.所以看起来 pipenv 没有删除第一个版本。 The Pipfile still has lines for both: Pipfile 仍然有两个行:

[packages.f8ba4b6]                                                               
file = "https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz"

[packages.0feb3d5]                                                               
file = "https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.3.0/es_core_news_sm-2.3.0.tar.gz"

And so does the Pipfile.lock: Pipfile.lock 也是如此:

"default": {                                                                 
    "0feb3d5": {                                                             
        "file": "https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.3.0/es_core_news_sm-2.3.0.tar.gz"
    }, 
    "f8ba4b6": {                                                             
        "file": "https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz"
    }
}

I also tried uninstalling them like this:我也尝试像这样卸载它们:

pipenv uninstall  es_core_news_sm en_core_web_sm
Un-installing es_core_news_sm…
Found existing installation: es-core-news-sm 2.3.0
Uninstalling es-core-news-sm-2.3.0:
  Successfully uninstalled es-core-news-sm-2.3.0

No package es_core_news_sm to remove from Pipfile.
Un-installing en_core_web_sm…
Found existing installation: en-core-web-sm 2.2.0
Uninstalling en-core-web-sm-2.2.0:
  Successfully uninstalled en-core-web-sm-2.2.0

But the Pipenv still has the lines with the 2.0.0 version (the ones, I've pasted above).但是 Pipenv 仍然有 2.0.0 版本的行(我在上面粘贴的那些行)。

So far I have removed the obsolete 2.0.0 entry from Pipfile, then pipenv lock ed and now the Pipfile.lock does not have the 2.0.0 entry.到目前为止,我已经从 Pipfile 中删除了过时的 2.0.0 条目,然后pipenv lock ,现在 Pipfile.lock 没有 2.0.0 条目。 I however, wonder if the package is still in my.venv, poor lost soul.但是,我想知道 package 是否仍在 my.venv 中,可怜的失落的灵魂。

Have you tried looking in the virtual environment folder?您是否尝试过查看虚拟环境文件夹?

pipenv -venv

In my experience, the pipenv install/uninstall command only works for packages listed under [packages] and [dev-packages].根据我的经验,pipenv install/uninstall 命令仅适用于 [packages] 和 [dev-packages] 下列出的软件包。 Somehow your install command generated another section - so it seems like you did the right thing just to remove it.不知何故,您的安装命令生成了另一个部分 - 所以看起来您只是做了正确的事情来删除它。 If you install again using the same command as above:如果您使用与上述相同的命令再次安装:

pipenv install https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz#egg=es_core_news_sm

You should end up with something like this:你应该得到这样的结果:

[packages]
es-core-news-sm = {file = "https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz"}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM