從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,zlib
yum install zlib-devel
yum install zlib
錯誤 : ModuleNotFoundError: No module named '_ctypes'
安裝libffi-devel包
yum install libffi-devel
解決上述問題在我環境中便可安裝成功
創建軟鏈接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
安裝pypi-server
wheel-0.33.6.tar.gz
setuptools-git-1.2.tar.gz
pypiserver-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 install
ln -s /usr/local/python3/bin/pypi-server /usr/bin/pypi-server
pypi-server -p9090 /data/pypiserver
安裝uwsgi
uwsgi-2.0.18.tar.gz
pip3 install --trusted-host 10.100.150.211 -i http://10.100.150.211:9090/ uwsgi
ln -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
安裝Django
Django-2.1.11.tar.gz
asgiref-3.2.1.tar.gz
async-timeout-3.0.1.tar.gz
protobuf-3.9.1.tar.gz
pytz-2019.2.tar.gz
sqlparse-0.3.0.tar.gz
six-1.12.0.tar.gz
pip3 install --trusted-host 10.100.150.211 -i http://10.100.150.211:9090/ django
ln -s /usr/local/python3/bin/django-admin /usr/bin/django-admin
html