1.安装anaconda:
官网下载安装包,并放于指定目录下,运行:
执行bash Anaconda*.sh(Anaconda*.sh此为下载的完整文件名)
寻找文件位置:
find -name .bashrc
查看是否写入bashrc文件:
vim ~/.bashrc
使用
source ~/.bashrc
进行激活
再创建一个新的环境:
conda create -n your_env_name python=X.X(2.7、3.6)
使用如下两行,增加新的源,提升速度:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
python依赖库迁移:
导出原来的依赖库:
pip list --format=freeze > requirements.txt
在Linux环境下使用:
pip install -r requirements.txt
安装包,记得激活对应的conda环境,这样只安装在conda环境内
关闭Gunicorn进程树:
获取Gunicorn进程树:
pstree -ap|grep gunicorn
得到的结果如下
Python
| | |-grep,14519 --color=auto gunicorn
| -gunicorn,28097 /usr/local/bin/gunicorn query_site.wsgi:application -c … | |-gunicorn,14226 /usr/local/bin/gunicorn query_site.wsgi:application -c … | | |-{gunicorn},14229 | | |-{gunicorn},14230 | | |-{gunicorn},14231 | | |-{gunicorn},14232 | | |-{gunicorn},14233 | | |-{gunicorn},14234 | | |-{gunicorn},14236 | | |-{gunicorn},14237 | | |-{gunicorn},14238 | | |-{gunicorn},14239 | | |-{gunicorn},14240 | | |-{gunicorn},14241 | | |-{gunicorn},14242 | | |-{gunicorn},14243 | |-{gunicorn},14244
最后结束进程:
kill -9 28097