yum 安装Python3

yum install epel-release
yum install python34
注意:上面的安装方法并未安装pip和setuptools,如果你要安装这两个库可以使用下面的命令:

curl -O https://bootstrap.pypa.io/get-pip.py
/usr/bin/python3.4 get-pip.py

下一步安装git

yum -y install git

下一步下载人脸识别

git clone https://github.com/ageitgey/face_recognition.git

 

 

上面的好像不好用,下面开始安装3.6

安装Python3
1、安装EPEL:
sudo yum -y install epel-release
2、安装IUS软件源:
sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm
3、安装Python3.6:
sudo yum -y install python36u
4、安装pip3:
sudo yum -y install python36u-pip

5、检查一下安装情况,分别执行命令查看:
python3.6 -V
pip3.6 -V

 
添加软链接

使用python3去使用Python3.6:
ln -s /usr/bin/python3.6 /usr/bin/python3
复制代码pip3.6同理:
ln -s /usr/bin/pip3.6 /usr/bin/pip3
 

 

 

请注意:上面都没成功


 cd /etc/yum.repos.d/
 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo


yum clean all
yum makecache

yum install -y epel-release 

yum -y install epel-release
 yum -y install python-pip

 

默认python2.7.5的也失败了,下一步尝试升级成3.3的

系统环境centos 6.5
原python版本2.6.6
目标python版本3.5.1
1.下载python3.5
wget --no-check-certificate  http://www.python.org/ftp/python/3.3.0/Python-3.3.0.tgz
2.解压文件 编译 安装
  tar -xvzf Python-3.3.0.tgz
  cd Python-3.3.0
  ./configure --prefix=/home/python/soft_install/python3.3/
  make
  make install
  进入 安装目录下的bin目录,检查是否安装成功
  ./python3.3 -V    ---如果安装成功则会显示安装的版本号
  修改默认的python ,重新建立软链接
  ln -s /home/python/soft_install/python3.3/bin/python3.3 /usr/bin/python3

然后继续尝试、失败了。。。然后再尝试,然后又失败了,继续。。。。。。还在失败中。

 

这次可能很有希望,等待中


cd /etc/yum.repos.d/
rm -rf *
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
yum install -y epel-release
yum -y install https://centos7.iuscommunity.org/ius-release.rpm

 

yum -y install python36u
yum -y install python36u-pip
cd /usr/bin
ln -fs python3.6 python
ln -fs python3.6 python3

把下面两个版本改为2
vi /usr/bin/yum
vi /usr/libexec/urlgrabber-ext-down
ln -fn pip3.6 pip


 

 yum -y install cmake

git clone https://github.com/davisking/dlib.git
cd dlib
mkdir build
cd build
cmake ..
cmake --build . --config Release

yum install -y python36u-devel



pip install face_recognition

好像成功了,升级下pip

升级下pip
pip install --upgrade pip

你可能感兴趣的:(python)