当前位置:网站首页>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>边栏推荐
猜你喜欢

数据驱动的软件智能化开发| ChinaOSC

JS 内置构造函数 扩展 prototype 继承 借用构造函数 组合式 原型式creat 寄生式 寄生组合式 call apply instanceof

2022年最新的Android面试大厂必考174题(附带详细答案)

ECCV 2022 Oral | 满分论文!视频实例分割新SOTA: IDOL

设备树基本原理与操作方法

阿里巴巴政委体系-第九章、阿里政委启示录

LeetCode 622. Designing Circular Queues

高性能计算软件与开源生态| ChinaOSC

阿里巴巴政委体系-第七章、阿里政委培育

安装anaconda并创建虚拟环境
随机推荐
Postgresql源码(65)新快照体系Globalvis工作原理分析
云图说丨初识华为云微服务引擎CSE
ERROR: You don‘t have the SNMP perl module installed.
开源生态研究与实践| ChinaOSC
数据驱动的软件智能化开发| ChinaOSC
建模该从哪一步开始?给你分析,给零基础的你一些学习建议
Power button brush the topic of merging two orderly array
if/else或switch替换为Enum
花 30 美金请 AI 画家弄了个 logo,网友:画得非常好,下次别画了!
Postgresql中的pg_memory_barrier_impl和C的volatile
边缘盒子+时序数据库,美的数字化平台 iBuilding 背后的技术选型
阿洛的反思
群辉查看硬盘存储占用的方式
按需视觉识别:愿景和初步方案
1161 最大层内元素和——Leetcode天天刷【BFS】(2022.7.31)
设备树基本原理与操作方法
不要再用if-else
epoll + 线程池 + 前后置服务器分离
Compose原理-compose中是如何实现事件分法的
基础软件与开发语言开源论坛| ChinaOSC