Conda Environment Transfer
Made by Mike_Zhang
Unfold Linux Topics $\triangledown$
Intro
配置Conda环境常常是头疼的一个过程。更头疼的是,当你需要在不同的机器上配置相同的环境时,你需要重新安装这好不容易配置好的环境。本文将介绍如何将Conda环境无痛迁移到另一台机器上。
1. Conda Environment Transfer
1.1 Method 1 - Transfer the Entire Environment Folder
1.1.1 Step1: Pack the Environment
On source machine:
1 |
|
1.1.1.1 Error Handling: Cannot pack an environment with editable packages
Error:
1 |
|
Solution: Add --ignore-editable-packages
1 |
|
1.1.1.2 Error Handling: Files managed by conda were found to have been deleted/overwritten
Error:
1 |
|
Solution: Add --ignore-missing-files
1 |
|
1.1.2 Step2: Transfer the Packed Environment
Move the my_env.tar.gz
to the /home/xxx/anaconda3/envs
on the target machine
- Where
/home/xxx/anaconda3/envs
is the path to the Condaenvs
folder on the target machine. Modify it according to your machine.
1.1.3 Step3: Unpack and Activate the Environment
On the target machine:
1 |
|
1.2 Method 2 - Export and Import Environment via file
1.2.1 Step1: Export the Environment
On the source machine:
1 |
|
1.2.2 Step2: Transfer the Environment File
Move the my_env_environment.yml
to the target machine
1.2.3 Step3: Create and Activate the Environment
On the target machine:
1 |
|
References
Csdn.net, 2024. https://blog.csdn.net/weixin_44151034/article/details/139757268
Csdn.net, 2024. https://blog.csdn.net/maximejia/article/details/115385868
Segmentfault.com, 2024. https://segmentfault.com/a/1190000042192237
原创文章,转载请标明出处
Made by Mike_Zhang
感谢你的支持 | Thank you for supporting
Conda Environment Transfer
https://ultrafish.io/post/conda-env-transfer/