python - `pip3 freeze` 在开头打印很多包
问题描述
我创建virtualenv
和命令pip3 freeze
是因为我python3
用来运行我的项目。
virtualenv .
source bin/activate
pip3 freeze
但是,pip3 freeze
即使我还没有安装任何包,也会打印出 default(?) python3 包:
backports.weakref==1.0rc1
bleach==1.5.0
certifi==2017.7.27.1
chardet==3.0.4
configparser==3.5.0
defusedxml==0.5.0
Django==1.11.12
django-allauth==0.32.0
django-crispy-forms==1.6.1
django-filter==1.0.4
django-widget-tweaks==1.4.1
djangorestframework==3.7.7
enum34==1.1.6
flake8==3.4.1
flake8-docstrings==1.1.0
flake8-polyfill==1.0.1
html5lib==0.9999999
idna==2.5
Keras==2.0.6
Markdown==2.6.8
mccabe==0.6.1
numpy==1.13.1
oauthlib==2.0.2
olefile==0.44
Pillow==4.2.1
protobuf==3.3.0
pycodestyle==2.3.1
pydocstyle==2.0.0
pyflakes==1.5.0
python3-openid==3.1.0
pytz==2018.3
PyYAML==3.12
requests==2.18.3
requests-oauthlib==0.8.0
scipy==0.19.1
six==1.10.0
snowballstemmer==1.2.1
tensorflow==1.2.1
Theano==0.9.0
urllib3==1.22
Werkzeug==0.12.2
显然我不想为我的虚拟机安装 tensorflow 和 Theano。:(
为什么它有默认(?)python3 包?我们可以从头开始吗?
解决方案
如果可以的话,你确实有这些包裹import
。
import sys
然后检查print(sys.path)
哪些目录中有你的包。
通常site-packages
会列出一个类似的目录。
您可以pip3 uninstall <package>
不想要的,如果需要,从site-packages
目录中删除。但是pip3 uninstall
是首选。
请注意,您还可以通过执行以下操作来了解您的包裹位置:pip3 show numpy
哪个打印:
Name: numpy
Version: 1.14.3
Summary: NumPy: array processing for numbers, strings, records, and objects.
Home-page: http://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: None
License: BSD
Location: c:\python36\lib\site-packages
Requires:
Required-by: scipy, pandas
推荐阅读
- abap - 如何检查报告是否有翻译?
- xslt - 如何使用 XSLT 根据条件获取两个相同级别的节点值?
- jquery - 如何在添加类 div 后面添加类延迟或删除类执行?
- asp.net-mvc - 如何在 Umbraco 的另一个程序集中引用 App_Plugins 文件夹?
- asp.net - 导入多个文本文件以访问数据库
- python-3.x - 如何将数据框中的值更改为另一个数据框中的值,并具有最接近的匹配?
- docker - kubernetes 节点网络从 kubernetes master 分裂时的 Pod 状态
- sql - 使用子查询添加具有不同 where 子句的列
- wordpress - 复选框没有解析出我在数组中分配的数据
- r - 基础 R 中的什么函数可以被认为等同于 %>% (管道)?