Skip to content

Instantly share code, notes, and snippets.

@shesl-meow
Created March 2, 2019 15:15
Show Gist options
  • Save shesl-meow/dc8ca808de1fe2db7d77016e5298183a to your computer and use it in GitHub Desktop.
Save shesl-meow/dc8ca808de1fe2db7d77016e5298183a to your computer and use it in GitHub Desktop.
python 3.6 uwsgi 环境配置的初始化脚本
#!/usr/bin/env bash
cd `dirname $0`
# TODO: install all system requirement
sudo apt-get install nginx python3.6 python3.6-dev \
uwsgi uwsgi-src uuid-dev libcap-dev libpcre3-dev
# TODO: build python3.6 plugin for uwsgi
export PYTHON=python3.6
uwsgi --build-plugin "/usr/src/uwsgi/plugins/python python36"
sudo mv python36_plugin.so /usr/lib/uwsgi/plugins/python36_plugin.so
sudo chmod 644 /usr/lib/uwsgi/plugins/python36_plugin.so
# TODO: install virtual environment &
# TODO: install all requirement.txt on virtualenv
sudo pip install virtualenv virualenvwrapper
export WORKON_HOME=~/.python_envs
source virtualenvwrapper.sh
mkvirtualenv -p /usr/bin/python3.6 PythonEnv
pip install -r ./requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment