在Centos7中安装Python 3.6.3(不删除系统自带的2.7.5)

[vagrant@localhost ~]$ sudo yum install yum-utils

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirrors.aliyun.com

 * epel: mirrors.ustc.edu.cn

 * extras: mirrors.shuosc.org

 * updates: mirrors.shuosc.org

Package yum-utils-1.1.31-42.el7.noarch already installed and latest version

Nothing to do


[vagrant@localhost ~]$ sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm

Loaded plugins: fastestmirror

ius-release.rpm                                                                                                                                             | 8.1 kB  00:00:00     

Examining /var/tmp/yum-root-bgDYJp/ius-release.rpm: ius-release-1.0-15.ius.centos7.noarch

Marking /var/tmp/yum-root-bgDYJp/ius-release.rpm to be installed

Resolving Dependencies

--> Running transaction check

---> Package ius-release.noarch 0:1.0-15.ius.centos7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


===================================================================================================================================================================================

 Package                                   Arch                                 Version                                           Repository                                  Size

===================================================================================================================================================================================

Installing:

 ius-release                               noarch                               1.0-15.ius.centos7                                /ius-release                               8.5 k


Transaction Summary

===================================================================================================================================================================================

Install  1 Package


Total size: 8.5 k

Installed size: 8.5 k

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : ius-release-1.0-15.ius.centos7.noarch                                                                                                                           1/1 

  Verifying  : ius-release-1.0-15.ius.centos7.noarch                                                                                                                           1/1 


Installed:

  ius-release.noarch 0:1.0-15.ius.centos7                                                                                                                                          


Complete!


[vagrant@localhost ~]$ sudo yum install python36u

Loaded plugins: fastestmirror

ius                                                                                                                                                         | 2.3 kB  00:00:00     

ius/x86_64/primary_db                                                                                                                                       | 234 kB  00:00:00     

Loading mirror speeds from cached hostfile

 * base: mirrors.aliyun.com

 * epel: mirrors.ustc.edu.cn

 * extras: mirrors.shuosc.org

 * ius: mirrors.tuna.tsinghua.edu.cn

 * updates: mirrors.shuosc.org

Resolving Dependencies

--> Running transaction check

---> Package python36u.x86_64 0:3.6.3-1.ius.centos7 will be installed

--> Processing Dependency: python36u-libs(x86-64) = 3.6.3-1.ius.centos7 for package: python36u-3.6.3-1.ius.centos7.x86_64

--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: python36u-3.6.3-1.ius.centos7.x86_64

--> Running transaction check

---> Package python36u-libs.x86_64 0:3.6.3-1.ius.centos7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


===================================================================================================================================================================================

 Package                                       Arch                                  Version                                              Repository                          Size

===================================================================================================================================================================================

Installing:

 python36u                                     x86_64                                3.6.3-1.ius.centos7                                  ius                                 56 k

Installing for dependencies:

 python36u-libs                                x86_64                                3.6.3-1.ius.centos7                                  ius                                8.7 M


Transaction Summary

===================================================================================================================================================================================

Install  1 Package (+1 Dependent package)


Total download size: 8.7 M

Installed size: 39 M

Is this ok [y/d/N]: y

Downloading packages:

warning: /var/cache/yum/x86_64/7/ius/packages/python36u-3.6.3-1.ius.centos7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 9cd4953f: NOKEY

Public key for python36u-3.6.3-1.ius.centos7.x86_64.rpm is not installed

(1/2): python36u-3.6.3-1.ius.centos7.x86_64.rpm                                                                                                             |  56 kB  00:00:00     

(2/2): python36u-libs-3.6.3-1.ius.centos7.x86_64.rpm                                                                                                        | 8.7 MB  00:00:18     

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                              492 kB/s | 8.7 MB  00:00:18     

Retrieving key from file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY

Importing GPG key 0x9CD4953F:

 Userid     : "IUS Community Project "

 Fingerprint: 8b84 6e3a b3fe 6462 74e8 670f da22 1cdf 9cd4 953f

 Package    : ius-release-1.0-15.ius.centos7.noarch (installed)

 From       : /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : python36u-3.6.3-1.ius.centos7.x86_64                                                                                                                            1/2 

  Installing : python36u-libs-3.6.3-1.ius.centos7.x86_64                                                                                                                       2/2 

  Verifying  : python36u-libs-3.6.3-1.ius.centos7.x86_64                                                                                                                       1/2 

  Verifying  : python36u-3.6.3-1.ius.centos7.x86_64                                                                                                                            2/2 


Installed:

  python36u.x86_64 0:3.6.3-1.ius.centos7                                                                                                                                           


Dependency Installed:

  python36u-libs.x86_64 0:3.6.3-1.ius.centos7                                                                                                                                      


Complete!


[vagrant@localhost ~]$ python3.6 -V

Python 3.6.3


再安装3.6对应的pip


[vagrant@localhost ~]$ sudo yum install python36u-pip

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirrors.aliyun.com

 * epel: mirrors.ustc.edu.cn

 * extras: mirrors.shuosc.org

 * ius: mirrors.tuna.tsinghua.edu.cn

 * updates: mirrors.shuosc.org

Resolving Dependencies

--> Running transaction check

---> Package python36u-pip.noarch 0:9.0.1-1.ius.centos7 will be installed

--> Processing Dependency: python36u-setuptools for package: python36u-pip-9.0.1-1.ius.centos7.noarch

--> Running transaction check

---> Package python36u-setuptools.noarch 0:33.1.1-1.ius.centos7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


===================================================================================================================================================================================

 Package                                           Arch                                Version                                              Repository                        Size

===================================================================================================================================================================================

Installing:

 python36u-pip                                     noarch                              9.0.1-1.ius.centos7                                  ius                              1.8 M

Installing for dependencies:

 python36u-setuptools                              noarch                              33.1.1-1.ius.centos7                                 ius                              648 k


Transaction Summary

===================================================================================================================================================================================

Install  1 Package (+1 Dependent package)


Total download size: 2.4 M

Installed size: 12 M

Is this ok [y/d/N]: y

Downloading packages:

(1/2): python36u-pip-9.0.1-1.ius.centos7.noarch.rpm                                                                                                         | 1.8 MB  00:00:01     

(2/2): python36u-setuptools-33.1.1-1.ius.centos7.noarch.rpm                                                                                                 | 648 kB  00:00:01     

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                              1.3 MB/s | 2.4 MB  00:00:01     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : python36u-setuptools-33.1.1-1.ius.centos7.noarch                                                                                                                1/2 

  Installing : python36u-pip-9.0.1-1.ius.centos7.noarch                                                                                                                        2/2 

  Verifying  : python36u-setuptools-33.1.1-1.ius.centos7.noarch                                                                                                                1/2 

  Verifying  : python36u-pip-9.0.1-1.ius.centos7.noarch                                                                                                                        2/2 


Installed:

  python36u-pip.noarch 0:9.0.1-1.ius.centos7                                                                                                                                       


Dependency Installed:

  python36u-setuptools.noarch 0:33.1.1-1.ius.centos7                                                                                                                               


Complete!

[vagrant@localhost ~]$ pip3.6


Usage:   

  pip [options]


Commands:

  install                     Install packages.

  download                    Download packages.

  uninstall                   Uninstall packages.

  freeze                      Output installed packages in requirements format.

  list                        List installed packages.

  show                        Show information about installed packages.

  check                       Verify installed packages have compatible dependencies.

  search                      Search PyPI for packages.

  wheel                       Build wheels from your requirements.

  hash                        Compute hashes of package archives.

  completion                  A helper command used for command completion.

  help                        Show help for commands.


General Options:

  -h, --help                  Show help.

  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.

  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.

  -V, --version               Show version and exit.

  -q, --quiet                 Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).

  --log                 Path to a verbose appending log.

  --proxy             Specify a proxy in the form [user:passwd@]proxy.server:port.

  --retries         Maximum number of retries each connection should attempt (default 5 times).

  --timeout             Set the socket timeout (default 15 seconds).

  --exists-action     Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.

  --trusted-host   Mark this host as trusted, even though it does not have valid or any HTTPS.

  --cert               Path to alternate CA bundle.

  --client-cert         Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.

  --cache-dir

          Store the cache data in .

  --no-cache-dir              Disable the cache.

  --disable-pip-version-check

                              Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.





你可能感兴趣的:(在Centos7中安装Python 3.6.3(不删除系统自带的2.7.5))