CentOS 7下Python 3安装pip-9.0.1
pip类似RedHat里面的yum,安装Python包非常方便。本节详细介绍pip的安装、以及使用方法。
1、下载pip安装包
[root@localhost ~]# wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
2、解压pip安装包
[root@localhost ~]# tar xf pip-9.0.1.tar.gz
3、安装pip
[root@localhost ~]# cd pip-9.0.1
[root@localhost pip-9.0.1]# python3 setup.py install
4、pip使用详解
pip安装模块报错,提示没有ssl模块
[root@localhost ipython-6.1.0]# pip install traitlets
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting traitlets
Could not fetch URL https://pypi.python.org/simple/traitlets/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement traitlets (from versions: )
No matching distribution found for traitlets
#没有安装openssl-devel,然后重新编译安装python3.6
[root@localhost pip-9.0.1]# yum install openssl-devel -y
#进入python3.6解压包目录
[root@localhost Python-3.6.1]#make clean
[root@localhost Python-3.6.1]# ./configure
[root@localhost Python-3.6.1]# make && make install
安装openssl-devel并重新编译安装python3后,再次测试pip安装模块
[root@localhost ~]# pip install 'traitlets'
Collecting traitlets
Downloading traitlets-4.3.2-py2.py3-none-any.whl (74kB)
100% |?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..| 81kB 87kB/s
Collecting six (from traitlets)
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting ipython-genutils (from traitlets)
Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting decorator (from traitlets)
Downloading decorator-4.0.11-py2.py3-none-any.whl
Installing collected packages: six, ipython-genutils, decorator, traitlets
Successfully installed decorator-4.0.11 ipython-genutils-0.2.0 six-1.10.0 traitlets-4.3.2
#安装成功
pip uninstall Package:卸载模块
[root@localhost pip-9.0.1]# pip uninstall traitlets
Uninstalling traitlets-4.3.2:
......
packages/traitlets/utils/tests/test_importstring.py
Proceed (y/n)? y
Successfully uninstalled traitlets-4.3.2
pip freeze:按需求格式输出已安装的模块
[root@localhost pip-9.0.1]# pip freeze
decorator==4.0.11
ipython==6.1.0
ipython-genutils==0.2.0
pexpect==4.2.1
ptyprocess==0.5.2
Pygments==2.2.0
six==1.10.0
traitlets==4.3.2
pip list --format=(legacy|columns):安装指定格式输出已安装的模块;和pip freeze类似
[root@localhost pip-9.0.1]# pip list --format=legacy
decorator (4.0.11)
ipython (6.1.0)
ipython-genutils (0.2.0)
pexpect (4.2.1)
pip (9.0.1)
ptyprocess (0.5.2)
Pygments (2.2.0)
setuptools (28.8.0)
six (1.10.0)
traitlets (4.3.2)
[root@localhost pip-9.0.1]# pip list --format=columns
Package Version
---------------- -------
decorator 4.0.11
ipython 6.1.0
ipython-genutils 0.2.0
pexpect 4.2.1
pip 9.0.1
ptyprocess 0.5.2
Pygments 2.2.0
setuptools 28.8.0
six 1.10.0
traitlets 4.3.2
pip show Package:显示已安装的模块信息
[root@localhost pip-9.0.1]# pip show traitlets
Name: traitlets
Version: 4.3.2
Summary: Traitlets Python config system
Home-page:
Author: IPython Development Team
Author-email: [email protected]
License: BSD
Location: /usr/local/lib/python3.6/site-packages
Requires: ipython-genutils, six, decorator
pip -h:余下的选项可以通过-h查看,这里不做过多介绍
[root@localhost pip-9.0.1]# pip -h
Usage:
pip <command> [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> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port.
--retries <retries> Maximum number of retries each connection should attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host as trusted, even though it does not have valid or any HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--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.
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/server/jiqiao/8820.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
EasyDSS RTMP流媒体服务器运
时间:2021-01-07
-
Linux客户端访问NFS报Permi
时间:2021-01-07
-
MobaXterm中运行脚本出现c
时间:2021-01-07
-
解决启动Nginx出现"'THRE
时间:2020-12-29
-
centeros7的redis-cli命令不生
时间:2020-12-29
-
本地java链接远程服务器
时间:2020-12-29
-
在不重启的情况下为Vmwa
时间:2020-12-28
-
英特尔修复Linux CPU漏洞:
时间:2020-12-28
热门文章
-
4种绕过Linux/Unix命令别名的方法
时间:2020-12-26
-
如何检查你的计算机使用的是UEFI还是BI
时间:2020-12-26
-
在Linux下为X1 Carbon CPU降压
时间:2020-12-26
-
为你的Fedora系统增添发音功能
时间:2020-12-28
-
英特尔修复Linux CPU漏洞:19年前的奔腾3也
时间:2020-12-28
-
使用molly-guard保护你的Linux/Unix机器不会被
时间:2020-12-28
-
解决启动Nginx出现"'THREAD_CONCURRENCY' is d
时间:2020-12-29
-
本地java链接远程服务器Linux上redis出错解
时间:2020-12-29
-
Intel CPU底层漏洞事件完全详解:包括修复
时间:2020-12-28
-
在不重启的情况下为Vmware Linux客户机添加
时间:2020-12-28
