前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Python command

Python command

作者头像
AngelNH
发布2020-04-15 17:13:47
6120
发布2020-04-15 17:13:47
举报
文章被收录于专栏:AngelNIAngelNI

不是 ,有钱才善良,而是善良才富足。

  1. pip升级 pip show pip python -m pip install –upgrade pip
  2. 列出已安装的包 pip list
  3. pip安装包 pip install 安装包名
  4. pip查看是否已安装 pip show [–files] 安装包名
  5. pip检查哪些包需要更新 pip list –outdated
  6. pip升级包 pip install –upgrade 要升级的包名
  7. pip卸载包 pip uninstall 要卸载的包名
  8. pip搜索包 pip search SomePackage
  9. pip参数解释 pip --help 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. config Manage local and global configuration. 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. --no-color Suppress colored output
  10. 将pip源更换到国内镜像 常用的国内镜像包括: (1)阿里云 http://mirrors.aliyun.com/pypi/simple/ (2)豆瓣http://pypi.douban.com/simple/ (3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ (4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/ (5)华中科技大学http://pypi.hustunique.com/

(1) 临时使用: 可以在使用pip的时候,加上参数-i和镜像地址(如https://pypi.tuna.tsinghua.edu.cn/simple)。 例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas,这样就会从清华镜像安装pandas库。

(2) 永久修改,一劳永逸:

windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,然后新建文件pip.ini,即 %HOMEPATH%\pip\pip.ini,在pip.ini文件中输入以下内容(以豆瓣镜像为例):

代码语言:javascript
复制
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-08-11|,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档