CentOS release 6.8
CentOS yum scheint nur mit der vorinstallierten Version von Python zu funktionieren. Wenn Sie also die neueste Version von Python installieren, kann Ihr System kaputt gehen, daher sollten Sie dies nicht tun. Daher scheint es den Trick zu verwenden, Python unter / usr / local zu installieren. Die Vorgehensweise für Squid ist in So installieren Sie die neueste Version von Python unter CentOS beschrieben. Das Verfahren ist wie es ist.
Ich habe gehört, dass ich Entwicklungstools herunterladen muss
# Compilers and related tools:
yum groupinstall -y "development tools"
# Libraries needed during compilation to enable all features of Python:
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel
# If you are on a clean "minimal" install of CentOS you also need the wget tool:
yum install -y wget
Wget dann den Python 2 und 3 Quellcode und kompiliere ihn
# Python 2.7.13:
wget http://python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
tar xf Python-2.7.13.tar.xz
cd Python-2.7.13
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
# Python 3.6.0:
wget http://python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
tar xf Python-3.6.0.tar.xz
cd Python-3.6.0
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
Ich weiß nicht, was du tust, aber ich habe das vorerst getan
strip /usr/local/lib/libpython2.7.so.1.0
strip /usr/local/lib/libpython3.6m.so.1.0
Als nächstes kommt die Installation von pip, aber es scheint ein Python-Skript dafür zu geben, wget es und führen Sie es aus.
# First get the script:
wget https://bootstrap.pypa.io/get-pip.py
# Then execute it using Python 2.7 and/or Python 3.6:
python2.7 get-pip.py
python3.6 get-pip.py
Jetzt können Sie pip install
verwenden! Yay!
Recommended Posts