当前位置:   article > 正文

服务器打包conda环境_使用ananconda直接在服务器之间快速迁移环境

conda环境打包

最近要把服务器上的资源迁移到本地服务器上,于是就有了这片帖子

迁移环境可以用anaconda直接实现:

conda install-c conda-forge conda-pack

或者

pip install conda-pack

然后

# Pack environment my_env into my_env.tar.gz

$ conda pack-n my_env

# Pack environment my_env into out_name.tar.gz

$ conda pack-n my_env-o out_name.tar.gz

# Pack environment located at an explicit path into my_env.tar.gz

$ conda pack-p/explicit/path/to/my_env

然后把打包好的文件迁移到另外一个服务器中

# Unpack environment into directory `my_env`$ mkdir-p my_env

$tar-xzf my_env.tar.gz-C my_env

# Use Python without activating or fixing the prefixes. Most Python

# libraries will work fine, but things that require prefix cleanups

# will fail.

$./my_env/bin/python

# Activate the environment. This adds `my_env/bin` to your path

$ source my_env/bin/activate# Run Python from in the environment(my_env)

$ python# Cleanup prefixes from in the active environment.

# Note that this command can also be run without activating the environment

# as long as some version of Python is already installed on the machine.(my_env)

$ conda-unpack

至此,迁移工作已经完成

顺便附上一些常用的操作

ps -ef|grep python 用于查询所有python进程

https://blog.csdn.net/jsk_learner/article/details/102468919 用于解决可能出现的编译器问题

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/180167
推荐阅读
相关标签
  

闽ICP备14008679号