Anaconda Python:虚拟环境存储在哪里? [英] Anaconda Python: where are the virtual environments stored?
问题描述
我是Anaconda Python的新手,我正在Sublime Text 3中建立一个项目.我已经安装了Anaconda并使用以下命令创建了虚拟环境:
I am new to Anaconda Python and I am setting up a project in Sublime Text 3. I have installed Anaconda and created a virtual environment using:
conda create -n python27 python=2.7 anaconda
conda create -n python35 python=3.5 anaconda
我无法为SublimeText 3设置Virtualenvs插件.
I am having trouble setting up the Virtualenvs plugin for SublimeText 3.
当我尝试时,它会问我要提供的virtualenvs路径:
When I try, it asks me for a virtualenvs path which I give:
~/users/../anaconda/envs/python27
然后它询问我所假定的是python发行版的路径,因为它列出了python系统版本的文件路径-但没有列出anaconda安装.
Then it asks for what I'm assuming is a path to a python distribution because it lists file paths for the system versions of python -- but not the anaconda install.
我没有使用插件的真正愿望,我只想能够同时使用这两个版本的python.我可以使用项目设置文件来设置python的版本吗?
I have no real desire to use the plug in, I just want to be able to use both versions of python. Could I use a project settings file to set the version of python instead?
推荐答案
如果激活您感兴趣的环境,则可以在环境变量中找到答案.
If you activate the environment you're interested in, you can find that answer in the environment variables.
在MacOS/Linux上:
on MacOS/Linux:
source activate python35
echo $CONDA_PREFIX
在Windows上:
conda activate python35
echo %CONDA_PREFIX%
您还可以运行conda info --envs
,它将显示所有环境的路径.
You can also run conda info --envs
, and that will show the paths to all your environments.
要获取特定环境正在使用的python实例的路径,请执行以下操作:
To get the path to the instance of python being used by a particular environment, do the following:
在MacOS/Linux上:
on MacOS/Linux:
source activate python35
which python
在Windows上:
conda activate python35
where python
这应该返回您要查找的路径.
That should return the path you're looking for.
这篇关于Anaconda Python:虚拟环境存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!