我的 Pipfile 的
[dev-packages]
部分中有一些不必要的软件包,我无法使用最新的 Pipenv (2024.0.1) 卸载它们。从 Pipfile 的 [packages]
部分卸载软件包效果很好。
我已经尝试了所有
pipenv uninstall packagename
、pipenv uninstall --dev packagename
和 pipenv uninstall -d packagename
都没有效果。
这是尝试卸载时的输出
python-docx
:
% pipenv uninstall --dev python-docx
Building requirements...
Resolving dependencies...
✔ Success!
Uninstalling python-docx...
pipenv uninstall --dev python-docx 8.97s user 1.07s system 84% cpu 11.921 total
Pipfile 中没有任何变化。 Pipfile.lock 有一些无关的更改,但仍然包含
python-docx
包。
% git diff Pipfile.lock
diff --git a/Pipfile.lock b/Pipfile.lock
index 5b761ce..b3ad052 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -296,14 +296,6 @@
"markers": "python_version >= '3.5'",
"version": "==3.6"
},
- "importlib-metadata": {
- "hashes": [
- "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e",
- "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc"
- ],
- "markers": "python_version < '3.10'",
- "version": "==7.0.1"
- },
"jinja2": {
"hashes": [
"sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa",
@@ -657,14 +649,6 @@
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'",
"version": "==1.26.18"
},
- "zipp": {
- "hashes": [
- "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31",
- "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"
- ],
- "markers": "python_version >= '3.8'",
- "version": "==3.17.0"
- },
"zope.event": {
"hashes": [
"sha256:2832e95014f4db26c47a13fdaef84cef2f4df37e66b59d8f1f4a8f319a632c26",
(END)
看来你必须先运行
pipenv uninstall --all-dev
删除所有开发包,然后重新安装你需要的包。