赞
踩
最近要把服务器上的资源迁移到本地服务器上,于是就有了这片帖子
迁移环境可以用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 用于解决可能出现的编译器问题
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。