conda迁移windows虚拟环境到linux

conda迁移windows虚拟环境到linux

近期使用python在windows下开发了一些算法,使用了conda来管理开发环境,准备迁移到linux下进行测试,Linux服务器在内网无法联网,迁移过程颇费周折,记录一下。

Conda是广为熟知的包管理器和虚拟环境管理器,有Anaconda,Miniconda两个版本,这里我使用的是Miniconda,安装过程略,安装好以后可以使用conda命令管理python软件包。

一、虚拟环境创建

在Windows下开发时,我使用conda创建了一个自己的虚拟环境,命令如下:

conda create --name test python=3.10

这里我创建了一个名称为test的虚拟环境,使用时需激活环境

conda activate test

最好将conda安装源配置成清华源

#查看镜像源
conda config --show channels

#删除添加源,恢复默认源
conda config --remove-key channels

#添加镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda conf

你可能感兴趣的:(AI,conda,windows,linux,python)