如何重命名 conda 环境?

How can I rename a conda environment?(如何重命名 conda 环境?)
本文介绍了如何重命名 conda 环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个名为 old_name 的 conda 环境,如何在不破坏引用的情况下将其名称更改为 new_name?

I have a conda environment named old_name, how can I change its name to new_name without breaking references?

推荐答案

你不能.

一种解决方法是 create 克隆一个新环境,然后 删除原来的那个.

One workaround is to create clone a new environment and then remove the original one.

首先,请记住停用您当前的环境.您可以使用以下命令执行此操作:

First, remember to deactivate your current environment. You can do this with the commands:

  • 停用(在 Windows 上)或
  • source deactivate 在 macOS/Linux 上.
  • deactivate on Windows or
  • source deactivate on macOS/Linux.

然后:

conda create --name new_name --clone old_name
conda remove --name old_name --all # or its alias: `conda env remove --name old_name`

注意这种方法有几个缺点:

Notice there are several drawbacks of this method:

  1. 它重新下载包(你可以使用 --offline 标志来禁用它)
  2. 复制环境文件所花费的时间
  3. 临时双盘使用

有一个开放的问题请求此功能.

There is an open issue requesting this feature.

这篇关于如何重命名 conda 环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)