当前位置:网站首页>Anaconda virtual environment migration
Anaconda virtual environment migration
2022-08-03 19:41:00 【ChaoFeiLi】
Because the lab has several servers at the same time, it is necessary to configure the same virtual environment without the server, so the migration of the virtual environment is considered, which is absolutely successful.
Reference link: On different Ubuntu servers, Anaconda's python virtual environment migration_qq_34292087's blog - CSDN blog

Premise introduction
Ubuntu18.04
anaconda3.5
Migration target: python3.6 (ie env1 in the above figure)
anaconda can manage multiple virtual environments, in the anaconda/envs directoryDown.If on server 1, we have 5 python environments (as shown above), we now need to copy env1 to the new server 2
Migration process
1. Copy anaconda/envs/env1 on server 1 to anaconda/envs on server 2
My environment name here is: Third
cd ~/anaconda3/envsscp -r [email protected] server IP:~/anaconda3/envs/Third ./2. Modify the pip file.The specific path of pip: ~/anaconda3/envs/env1/bin/pip or pip3 (preferably change both)
The absolute path of python in the first line needs to be modified correctly!!!(Otherwise pip install will report an error)
#!/home/lcf/anaconda3/envs/Third/bin/python# -*- coding: utf-8 -*-import reimport sysfrom pip._internal.cli.main import mainif __name__ == '__main__':sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])sys.exit(main())Change the "#!/home/lcf/anaconda3/envs/Third/bin/python" in the first line to the path of the destination environment
strong>边栏推荐
猜你喜欢
随机推荐
力扣刷题之有效的正方形(每日一题7/29)
阿里巴巴政委体系-第八章、阿里政委工作方法论
Force is brushed buckle problem for the sum of two Numbers
Redis 内存满了怎么办?这样置才正确!
友宏医疗与Actxa签署Pre-M Diabetes TM 战略合作协议
Postgresql快照优化Globalvis新体系分析(性能大幅增强)
面试突击:什么是粘包和半包?怎么解决?
微导纳米IPO过会:年营收4.28亿 君联与高瓴是股东
力扣刷题之合并两个有序数组
阿洛的反思
Kettle 读取 Excel 数据输出到 Oracle 详解
【leetcode】剑指 Offer II 009. 乘积小于 K 的子数组(滑动窗口、双指针)
开源生态研究与实践| ChinaOSC
建模该从哪一步开始?给你分析,给零基础的你一些学习建议
Line the last time the JVM FullGC make didn't sleep all night, collapse
CentOS 7 安装mysql
【木马免杀】
机器学习中专业术语的个人理解与总结(纯小白)
剑指 Offer II 044. 二叉树每层的最大值-dfs法
SQL server 实现触发器备份表数据









