从python官网下载最新版本安装包Python-3.7.4.tgz
放在目录/usr/local/python3下解压tar -zxvf Python-3.7.4.tgz进入解压目录cd /usr/local/python3/Python-3.7.4去掉 /usr/local/python3/Python-3.7.4/Modules/Setup.dist中#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz这行前面的注释#(注意:如果是configure之后去掉这个注释,那么需要修改Setup文件中的这行注释了)安装c编译器yum install gcc配置./configure --prefix=/usr/local/python3编译make安装make install错误:zipimport.ZipImportError: can't decompress data; zlib not available安装zlib-devel,zlibyum install zlib-develyum install zlib错误 : ModuleNotFoundError: No module named '_ctypes' 安装libffi-devel包yum install libffi-devel解决上述问题在我环境中即可安装成功建立软连接ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3安装pypi-serverwheel-0.33.6.tar.gzsetuptools-git-1.2.tar.gzpypiserver-master.zip解压缩tar -zxvf wheel-0.33.6.tar.gz tar -zxvf setuptools-git-1.2.tar.gz tar -zxvf pypiserver-master.zip 按顺序cd到对饮的目录中执行python3 setup.py installln -s /usr/local/python3/bin/pypi-server /usr/bin/pypi-serverpypi-server -p9090 /data/pypiserver安装uwsgiuwsgi-2.0.18.tar.gzpip3 install --trusted-host 10.100.150.211 -i http://10.100.150.211:9090/ uwsgiln -s /usr/local/python3/bin/uwsgi /usr/bin/uwsgi建立文件夹mkdir -p /www/myuwsgi创建文件test.py def application(env, start_response): start_response('200 ok',[('Content-Type','text/html')]) return b"Hello uwsgi!"启动uwsgi --http :8001 --wsgi-file test.py安装DjangoDjango-2.1.11.tar.gzasgiref-3.2.1.tar.gzasync-timeout-3.0.1.tar.gzprotobuf-3.9.1.tar.gzpytz-2019.2.tar.gzsqlparse-0.3.0.tar.gzsix-1.12.0.tar.gzpip3 install --trusted-host 10.100.150.211 -i http://10.100.150.211:9090/ djangoln -s /usr/local/python3/bin/django-admin /usr/bin/django-admin