Activating conda environment with its full path(使用完整路径激活 conda 环境)
问题描述
通常,我们使用以下命令激活 conda 环境:
Usually, we activate a conda environment with the command:
source activate env_name
是否可以使用完整路径激活 conda 环境?例如:
Is it possible to activate conda environment with its full path? For example:
source (fullpath)/bin/activate
当我这样做时,它会激活 anaconda 的默认环境,即根环境.
When I do this it activates the default environment of anaconda i.e the root environment.
推荐答案
conda 4.4 及更高版本更新:
需要指定conda环境路径才能激活.新的 conda activate
命令不再需要激活脚本"的完整路径,因为该命令现在是 conda 的内置".所以像:
You need to specify the conda environment path to activate. The new conda activate
command should not need the full path to an "activate script" any longer, since the command is now "built-in" to conda. So something like:
conda activate (fullpath)/env-name-here
应该可以.
您指定的命令激活了 root
环境,因为您没有给 conda 一个环境来激活,而 root
是默认的.如果你想激活一个特定的环境,你当然可以使用 activate
脚本的完整路径,例如
The command you have specified activates the root
environment because you have not given conda an environment to activate, and root
is the default. If you want to activate a particular environment, you can certainly do so with the full path to the activate
script, for instance
source (full path to main Anaconda directory)/bin/activate (fullpath)/env-name-here
^^^^^^^^^^^^^^^^^^^^^^^^
You're missing this part
这篇关于使用完整路径激活 conda 环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用完整路径激活 conda 环境


- padding='same' 转换为 PyTorch padding=# 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- pytorch 中的自适应池是如何工作的? 2022-07-12
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01
- python-m http.server 443--使用SSL? 2022-01-01
- 沿轴计算直方图 2022-01-01
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01