--
參考資源
--
Fix HTTP Error 404 Not Found Trying Other Mirror CentOS 7
1 2 3 4 5 |
sudo sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo sudo sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo sudo sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo sudo -- bash -c 'echo "sslverify=false" >> /etc/yum.conf' sudo yum update |
--
安裝流程
1 2 3 4 5 6 7 8 9 10 11 |
yum -y groupinstall "Development tools" yum install -y wget ncurses-devel gdbm-devel xz-devel sqlite-devel tk-devel uuid-devel readline-devel bzip2-devel libffi-devel openssl-devel openssl11 openssl11-devel mkdir -p tmp && cd tmp wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz export CFLAGS=$(pkg-config --cflags openssl11) export LDFLAGS=$(pkg-config --libs openssl11) tar xvzf Python-3.10.4.tgz cd Python-3.10.4 ./configure --enable-optimizations && make altinstall ln -sf /usr/local/bin/python3.10 /usr/bin/python3 ln -sf /usr/local/bin/pip3.10 /usr/bin/pip3 |
途中不需要重新開機
--
成果
1 2 |
# python3 --version Python 3.10.4 |
1 2 |
# pip3 --version pip 22.0.4 from /usr/local/lib/python3.10/site-packages/pip (python 3.10) |
--
pip3
1 2 |
pip3 install simplejson python3 -m pip install paho-mqtt==1.6.1 |
如果 pip3 install 無法安裝,可以換成 python3 -m pip install 試試看
需要指定版本,在名稱後面加上 == 版本號
--
1,140 total views, 3 views today