雲服務器Linux系統 centos7.x下 python環境安裝

CentOS7.2更改yum源與更新系統:https://blog.csdn.net/weixin_35934768/article/details/52637273

centos7.5下 python環境安裝

yum -y update
yum -y install zlib* unzip p7zip git zsh htop supervisor libssl* readline* pcre* sqlite* ncurses* llvm openssl* wget python-devel python-zope-interface libbz2* tk tk-devel tmux
yum group install "Development Tools"
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
tar xvf Python-3.7.2.tgz
cd Python-3.7.2
./configure --enable-optimizations
make -j8
make install

報錯中有 if not _ctypes ->

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libffi-devel-3.0.13-18.el7.x86_64.rpm
rpm -ivh libffi-devel-3.0.13-18.el7.x86_64.rpm

如果因爲服務器報錯 error: Failed dependencies:

rpm -ivh --nodeps libffi-devel-3.0.13-18.el7.x86_64.rpm

繼續

make -j8
make install

如果make 不了 調回python 目錄 重新make一次

If pip3 not found ->

curl https://bootstrap.pypa.io/get-pip.py | python3
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
pip3 install --upgrade pip
pip3 install --upgrade anyconfig asn1crypto cffi click cryptography daemonize flask flask-cors gevent greenlet idna itsdangerous jinja2 jsmin markupsafe olefile optionaldict peewee pillow pycparser pymysql python-dateutil pyyaml qrcode redis hiredis ujson requests setuptools six tornado wechatpy werkzeug xmltodict pydash mycli oss2 arrow schema xlrd cos-python-sdk-v5 xmltodict ipython pip pytest pylint yapf glances incremental pymysql
yum install git -y
git clone https://github.com/luvvien/pymysqlpool
pip3 install pymysqlpool/
wget https://twistedmatrix.com/Releases/Twisted/18.9/Twisted-18.9.0.tar.bz2
yum install bzip2 -y
tar xvf Twisted-18.9.0.tar.bz2
cd Twisted-18.9.0
python3 setup.py install

Nginx

wget https://nginx.org/download/nginx-1.15.10.tar.gz
tar xvf nginx-1.15.10.tar.gz
cd nginx-1.15.10
./configure --with-http_gzip_static_module --with-http_ssl_module --with-http_stub_status_module --with-http_v2_module --prefix=/usr/local/nginx && make && make install

Redis

cd /usr/src
wget http://download.redis.io/redis-stable.tar.gz
tar xvf redis-stable.tar.gz
cd redis-stable
make && make install
cd utils
chmod +x install_server.sh
./install_server.sh

(然後一路回車)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章