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

Network protocol-TCP, UDP difference and TCP three-way handshake, four wave

node版本切换工具NVM以及npm源管理器nrm

Interview Blitz: What Are Sticky Packs and Half Packs?How to deal with it?

分享即时通讯开发之WebSocket:概念、原理、易错常识、动手实践

1161 最大层内元素和——Leetcode天天刷【BFS】(2022.7.31)

LeetCode 622. 设计循环队列

虚拟机vmware设置nat模式上网

那些年我写过的语言

go语言实现导出string字符串到文件中

面试突击:什么是粘包和半包?怎么解决?
随机推荐
开发即时通讯到底需要什么样的技术,需要多久的时间
「游戏建模干货」建模大师几步操作,学习经典,赶紧脑补一下吧
盲僧发现了华点——教你如何使用API接口获取数据
高性能计算软件与开源生态| ChinaOSC
The effective square of the test (one question of the day 7/29)
Postgresql source code (64) Query execution - data structure and execution process before submodule Executor (2) execution
1-php学习笔记之数据类型
Line the last time the JVM FullGC make didn't sleep all night, collapse
ScrollView嵌套RV,滑动有阻力不顺滑怎么办?
Postgresql源码(65)新快照体系Globalvis工作原理分析
阿里巴巴政委体系-第六章、阿里政委体系运作
傅里叶变换(深入浅出)
redis常用命令,HSET,XADD,XREAD,DEL等
The addition and subtraction of the score of the force deduction brush question (a daily question 7/27)
力扣刷题之爬楼梯(7/30)
面试突击:什么是粘包和半包?怎么解决?
Introduction to Cosine Distance
多模态 参考资料汇总
剑指 Offer II 044. 二叉树每层的最大值-dfs法
matplotlib画polygon, circle