python3.5.2 with redhat7.2

Posted 乾坤颠倒

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python3.5.2 with redhat7.2相关的知识,希望对你有一定的参考价值。

2016/7/4 11:04:40  

1. download source package
  1. [[email protected]_TestData haozil]# wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
2. System information
  1. [[email protected] haozil]# cat /etc/redhat-release
    RedHatEnterpriseLinuxServer release 7.2(Maipo)
    [[email protected] haozil]# uname -a
    Linux mgt 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
    [[email protected] haozil]#

     

3. default python version
  1. [[email protected] haozil]# python -V
    Python2.7.5
    [[email protected] haozil]# whereis python
    python:/usr/bin/python /usr/bin/python2.7/usr/lib/python2.7/usr/lib64/python2.7/etc/python /usr/include/python2.7/usr/share/man/man1/python.1.gz
    [[email protected] haozil]#

     

4. Install
  1. [[email protected] haozil]# tar zxvf Python-3.5.2.tgz-C /usr/local/share/
    [[email protected] haozil]# ls /usr/local/share/
    applications info man perl5 Python-3.5.2
    [[email protected] Python-3.5.2]# pwd
    /usr/local/share/Python-3.5.2
    [[email protected] Python-3.5.2]# ./configure 
    [[email protected] Python-3.5.2]# make && make install

     

5. Completed
  1. [[email protected] Python-3.5.2]#/usr/local/bin/python3 -V
    Python3.5.2
    [[email protected] Python-3.5.2]# python3
    Python3.5.2(default,Jul42016,15:12:54)
    [GCC 4.8.520150623(RedHat4.8.5-4)] on linux
    Type"help","copyright","credits"or"license"for more information.
    >>> exit()

     

6. Miss sqlite3 lib --> should install the sqlite-devel package , and then reinstall .
  1. Python build finished successfully!
    The necessary bits to build these optional modules were not found:
    _bz2 _curses _curses_panel
    _dbm _gdbm _lzma
    _sqlite3 _ssl _tkinter
    readline zlib
    To find the necessary bits, look in setup.py in detect_modules()for the modules name.
    [[email protected] Python-3.5.2]# yum install readline-devel sqlite-devel bzip2-devel.x86_64 openssl-devel.x86_64 gdbm-devel.x86_64 libdbi-devel.x86_64 ncurses-libs zlib-devel.x86_64 xz-devel.x86_64 tk-devel -y



以上是关于python3.5.2 with redhat7.2的主要内容,如果未能解决你的问题,请参考以下文章

RedHat7.5 针对This system is not registered with an entitlement server问题,更换yum源

通过配置环境变量,直接运行python3.5.2

如何在 CentOS 上将 Python3.5.2 设置为默认 Python 版本?

centos6.8安装python3.5.2

python3.5.2库getpass

ubuntu12.04下安装Python3.5.2