Conda:将本地开发包安装到单个conda环境中 [英] Conda: installing local development package into single conda environment
问题描述
如果使用的是virtualenv,我将激活项目的虚拟环境,然后以开发模式安装正在开发的软件包.类似于以下内容:
If I were using a virtualenv, I would activate my project's virtual environment then install the package I am developing in develop mode. Something like the following:
workon superbad
pip install -e fnawesome
这使我的软件包fnawesome
可以通过superbad
虚拟环境中的任何代码更新进行访问.如果我切换到任何其他环境(包括默认环境),则superbad
id将无法访问.
This allows my package fnawesome
to be accessible with any code updates in my superbad
virtual environment. If I switch to any other environment, including the default environment, superbad
id not accessible.
人们如何使用conda进行类似的设置?
How are people doing similar setups using conda?
推荐答案
您可以配置默认软件包列表,这些默认软件包将自动安装到任何conda环境中
You can configure a list of default packages that will be installed into any conda environment automatically
conda config --add create_default_packages pip --add create_default_packages ipython
可以做到,以便conda create
在新环境中始终包含pip
和ipython
(此命令与添加
will make it so that conda create
will always include pip
and ipython
in new environments (this command is the same as adding
create_default_packages:
- ipython
- pip
到.condarc
文件).
要创建没有这些环境的环境,请使用conda create --no-default-packages
.
To create an environment without these, use conda create --no-default-packages
.
这篇关于Conda:将本地开发包安装到单个conda环境中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!