Rehat/Centos/Fedora 下安装Pyhton
如果你使用root帐户,那么下面(sudo)则可以省略。如果非root帐户,则(sudo)表示在命令前加sudo。
1,安装依赖:对于fedora/centos/redhat安装依赖为
(sudo) yum install -y gcc openssl openssl-devel sqlite-devel xml2 libxml2-devel libxslt libxslt-devel python-pyasn1 libffi-devel python-pyasn1-modules
2,安装Python和Pip(Python3自带Pip)
wget https://ogmcsrgk5.qnssl.com/pythona/software/python3.5.1/Python-3.5.1.tgz
tar xzvf Python-3.5.1.tgz
cd Python-3.5.1
./configure
make
(sudo) make install
cd ..
3,安装Git
wget https://ogmcsrgk5.qnssl.com/pythona/software/git/git-2.8.3.zip
unzip git-2.8.3.zip
cd git-2.8.3
(sudo) yum install libcurl-devel
(sudo) yum install expat-devel perl-ExtUtils-MakeMaker
make
(sudo) make install
(sudo) rm /usr/bin/git
(sudo) ln -s <git-2.8.3源代码目录>/git /usr/bin/git
git-2.8.3源代码目录指的是git-2.8.3那个目录的全路径,类似/root/git-2.8.3
如果你的系统是Fedora 22 或更新,使用下面命令
dnf install git
时间: 2024-10-10 23:10:14