conda 备份与还原环境

常用的镜像安装源网站

(1)阿里云 http://mirrors.aliyun.com/pypi/simple/

(2)豆瓣 http://pypi.douban.com/simple/

(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

(5)华中科技大学 http://pypi.hustunique.com/



作者:半腼色
链接:https://www.jianshu.com/p/59985b6e55bf
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

 

conda导出已有环境:

conda env export > environment.yaml

环境会被保存在 environment.yaml文件中。当我们想再次创建该环境,或根据别人提供的.yaml文件复现环境时,可以:

conda env create -f environment.yaml

就可以复现安装环境。移植过来的环境只是安装了你原来环境里用conda install等命令直接安装的包,你用pip之类装的东西没有移植过来,需要你重新安装。
pip导出安装的库到requirements.txt

pip freeze > requirements.txt

pip导入requirements.txt中列出的库到系统

pip install -r requirements.txt

posted on 2022-11-03 18:49  ttm6489  阅读(1014)  评论(0编辑  收藏  举报

导航