1、下载Python 3.5.1源码
2、运行,yum -y install zlib zlib-devel openssl-devel
3、解压,运行 ./configure --prefix=/usr/local/python-3.5.1
4、make && make install
5、运行python -V,记住系统自带的python版本号
6、ln -fs /usr/local/python-3.5.1/bin/python3.5 /usr/bin/python
7、ln -fs /usr/local/python-3.5.1/bin/pip3 /usr/bin/pip
8、vim /usr/bin/yum 改掉前缀 /usr/bin/python2.7
9、vim /usr/libexec/urlgrabber-ext-down 改掉前缀 /usr/bin/python2.7
10、pip install flask sqlalchemy oss2 uwsgi
11、ln -fs /usr/local/python-3.5.1/bin/uwsgi /usr/bin/uwsgi
12、uwsgi /data/configure/uwsgi.ini
=================
附录:
[uwsgi]
socket = 127.0.0.1:9000
callable = app
master = true
enable-thread = true
workers = 2
vhost = true
vacuum = true
daemonize = /data/logger/uwsgi.log
py-autoreload = true
时间: 2024-11-05 13:41:54