Python3.6 在centos7下使用rpm安装
2018年09月30日 16:42:15 vkingnew 阅读数:1749
版权声明:本文为博主原创文章,转载请注明出处 https://blog.csdn.net/vkingnew/article/details/82911352
1.在Redhat的官方提供的EPEL中已经有python3.6.6版本的RPM,而py36版本的pip在在IUS的仓库中有。
#wget http://mirrors.ustc.edu.cn/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
#wget http://mirrors.ustc.edu.cn/ius/stable/CentOS/7/x86_64/ius-release-1.0-15.ius.centos7.noarch.rpm
# rpm -ivh epel-release-7-11.noarch.rpm
# rpm -ivh ius-release-1.0-15.ius.centos7.noarch.rpm
2.搜索软件:
# yum search python36
# yum info python36
# yum info python36u
# yum info python36u-pip
3.直接使用yum安装:
yum -y install python36 python36u-pip python36u-redis python36-numpy
…
ependencies Resolved
=====================================================================
Package Arch Version Repository
Size
=====================================================================
Installing:
python36-numpy x86_64 1.10.4-6.el7 epel 2.8 M
python36u-redis noarch 2.10.6-1.ius.centos7 ius 112 k
Installing for dependencies:
atlas x86_64 3.10.1-12.el7 base 4.5 M
libgfortran x86_64 4.8.5-28.el7_5.1 updates 299 k
libquadmath x86_64 4.8.5-28.el7_5.1 updates 188 k
Transaction Summary
=====================================================================
Install 2 Packages (+3 Dependent packages)
…
4.版本验证:
# pip3.6 -V
pip 9.0.1 from /usr/lib/python3.6/site-packages (python 3.6)
# python36 -V
Python 3.6.6
5.pip3升级:
# pip3.6 install –upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 309kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-18.0
# pip
pip pip2 pip2.7 pip3 pip3.6
# pip3 -V
pip 18.0 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
6.安装常见的数据库驱动:
# pip3 install pymongo pymysql mysql-connector-python
# pip3 install neo4j-driver
# pip3 install psycopg2
pymongo 为mongodb官方的驱动
pymysql 为社区版本提供的mysql驱动程序,支持MySQL>=5.5版本。
mysql 官方为python36提供的驱动程序为mysql-connector-python,支持MySQL8.0版本和TiDB。
mysql官方的驱动程序也可以通过mysql官方网站下载RPM包安装。
neo4j-driver 是neo4j官方提供的驱动程序。
psycopg2 为pg官方认可的驱动,支持pg和cockroachDB。
# pip3 list | grep -i -E ‘my|mongo|redis’
mysql-connector-python 8.0.12
pymongo 3.7.1
PyMySQL 0.9.2
redis 2.10.6
7.安装大数据相关的软件API:elasticsearch 、apache strom、apache spark、apache kafka、apache hbase等.
# pip3 install elasticsearch
# pip3 install pystorm pyspark
# pip3 install hbase-python kafka
8.更多软件可以在网站上搜索:https://pypi.org
在python3上安装驱动:# pip3 install mysqlclient
需要确认安装python36-devel和mysql-devel以及gcc,否则安装不通过。
yum -y install python36-devel
参考:https://pypi.org/project/mysqlclient/
转载请注明:SuperIT » Python3.6 在centos7下使用rpm安装