简体   繁体   English

为什么conda安装pip / setuptools等…?

[英]Why does conda install pip/setuptools etc…?

I am using conda to create clean environments for each my my python projects. 我正在使用conda为我的每个python项目创建干净的环境。 I'd like to bootstrap the environmetn with only python, and not muddy it up wtih dependencies that aren't necessary. 我只想用python引导环境,而不用不必要的依赖来混淆环境。 I noticed that when creating a barebones venv with anaconda: 我注意到在用anaconda创建准系统venv时:

conda create --name myenv python

It must install the following new packages, 它必须安装以下新软件包,

certifi:        2017.11.5-py36hb8ac631_0
pip:            9.0.1-py36h226ae91_4
python:         3.6.3-h3b118a2_4
setuptools:     36.5.0-py36h65f9e6e_0
vc:             14-h2379b0c_2
vs2015_runtime: 14.0.25123-hd4c4e62_2
wheel:          0.30.0-py36h6c3ec14_1
wincertstore:   0.2-py36h7fe50ca_0

Does conda require these in some sense to operate? conda在某种意义上是否需要这些操作? Can they be kept out of the installation if one only plans to use the python standard library? 如果只打算使用python标准库,可以将它们排除在安装范围之外吗?

Then don't run them. 然后不要运行它们。 The point of these dependencies are that you can't extend your environment with any third party libraries unless they are present, and most projects do depend on some third party libraries (or that your own library should be installable) - so they're installed by default, since they're usually required and useful. 这些依赖关系的重点是,除非存在第三方库,否则您无法使用任何第三方库扩展您的环境,并且大多数项目确实依赖于某些第三方库(或者您自己的库应可安装)-因此已安装默认情况下,因为它们通常是必需和有用的。

You can ask the conda venv create script to not include any default packages with --no-default-packages and --no-deps . 您可以要求conda venv创建脚本不包括带有--no-default-packages--no-deps任何默认软件包。 The official virtualenv package supports --no-pip , --no-setuptools and --no-wheel to skip them. 官方的virtualenv软件包支持--no-pip--no-setuptools--no-wheel来跳过它们。

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

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