英文:
What globally installed Python Packages should I uninstall?
问题
-
在进入虚拟环境 (.venv) 之前,我曾经不小心通过 pip 安装了 Python 包,因此在全局范围内安装了它们。
-
最近,我认为我一直与全局安装的这些包发生冲突,希望卸载所有不必要的包,因为我认为所有我的项目应该在它们自己的虚拟环境中安装包。
-
我不是100%确定,但相信某些包是随最初的 Python 安装一起的。我的问题是,我应该卸载它们中的所有包,还是哪些包应该保留,因为它们是全局标准的?我的当前 Python 版本是 3.8.1,我当前安装的全局包如下:
- certifi 2022.5.18.1
- charset-normalizer 2.0.12
- click 8.1.3
- colorama 0.4.6
- connectorx 0.3.1
- greenlet 1.1.2
- idna 3.3
- importlib-metadata 5.1.0
- itsdangerous 2.1.2
- Jinja2 3.1.2
- MarkupSafe 2.1.1
- pip 23.0.1
- pyparsing 3.0.9
- python-dateutil 2.8.2
- pytz 2022.7
- setuptools 41.2.0
- six 1.16.0
- SQLAlchemy 1.4.44
- threadpoolctl 3.1.0
- urllib3 1.26.14
- Werkzeug 2.2.2
- zipp 3.11.0
-
我尝试在网上搜索,但似乎找不到任何关于此的信息。特别是最近,我遇到了一个冲突,下载库 cryptography==38.0.3,通过卸载全局缓存的 cffi 包来解决了这个问题。
英文:
I have in the past installed Python packages through pip before entering the virtual environment (.venv) by accident, therefore installing them globally. Recently, I believe I've been having conflicts with said globally installed packages and wish to uninstall all the unnecessary ones, as i believe all my projects should install packages in their own virtual environments.
I'm not 100% sure, but believe some packages come with the initial Python installation. My question is, should i uninstall all of them or which ones should I keep, as they are standard to have globally? My current Python version is 3.8.1 and my currently installed global packages are listed below:
- certifi 2022.5.18.1
- charset-normalizer 2.0.12
- click 8.1.3
- colorama 0.4.6
- connectorx 0.3.1
- greenlet 1.1.2
- idna 3.3
- importlib-metadata 5.1.0
- itsdangerous 2.1.2
- Jinja2 3.1.2
- MarkupSafe 2.1.1
- pip 23.0.1
- pyparsing 3.0.9
- python-dateutil 2.8.2
- pytz 2022.7
- setuptools 41.2.0
- six 1.16.0
- SQLAlchemy 1.4.44
- threadpoolctl 3.1.0
- urllib3 1.26.14
- Werkzeug 2.2.2
- zipp 3.11.0
I have tried searching online, but could not seem to find any information regarding this. In particular, recently, I had a conflict downloading the library cryptography==38.0.3, that got solved by uninstalling a globally cached cffi package.
答案1
得分: 0
你可以安全地移除由pip安装的所有包,无论是系统范围还是用户范围。Python不会默认安装在Windows上,所以这些都不是系统本身必需的。
然后,你可以简单地重新安装Python,以确保一切恢复正常。
不幸的是,pip目前仍然没有一种方便的方法可靠地移除一个包以及其所有未使用的依赖项,这将使从这种情况中恢复变得更容易。
英文:
You can safely remove all packages installed by pip, both system-wide and user-wide. Python does not come with Windows by default, so none of it is essential to the system itself
You can then simply reinstall Python afterwards to make sure everything is back to normal.
Unfortunately, pip still doesn't have a convenient to reliably remove all unused dependencies together with a package, which would make such situations much easier to recover from.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论