当前位置:网站首页>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>边栏推荐
- Postgresql source code (65) analysis of the working principle of the new snapshot system Globalvis
- ECCV 2022 Oral | 满分论文!视频实例分割新SOTA: IDOL
- Postgresql source code (64) Query execution - data structure and execution process before submodule Executor (2) execution
- LeetCode 952. Calculate Maximum Component Size by Common Factor
- 软件测试回归案例,什么是回归测试?
- go语言实现导出string字符串到文件中
- 阿洛的反思
- 演讲议题及嘉宾重磅揭晓,TDengine 开发者大会推动数据技术“破局”
- 云图说丨初识华为云微服务引擎CSE
- Introduction to Cosine Distance
猜你喜欢
随机推荐
CS免杀姿势
ScrollView嵌套RV,滑动有阻力不顺滑怎么办?
数据驱动的软件智能化开发| ChinaOSC
CentOS 7 安装mysql
详解AST抽象语法树
DeepMCP网络详解
面试突击:什么是粘包和半包?怎么解决?
单调栈及其应用
Postgresql source code (65) analysis of the working principle of the new snapshot system Globalvis
微导纳米IPO过会:年营收4.28亿 君联与高瓴是股东
阿里巴巴政委体系-第七章、阿里政委培育
阿里二面:多线程间的通信方式有几种?举例说明
开源教育论坛| ChinaOSC
力扣刷题之移动零
分享即时通讯开发之WebSocket:概念、原理、易错常识、动手实践
力扣刷题之爬楼梯(7/30)
怎么将自己新文章自动推送给自己的粉丝(巨简单,学不会来打我)
Word另存为PDF后无导航栏解决办法
【木马免杀】
dpkg强制安装软件