python常用命令大全-Python pip 常用命令汇总

使用了这么就pip命令,但是一直是简单使用,很多命令都是用了查,查了用,今天把常用的命令汇总一下,方便使用。

命令:

pip

20201019105940975.png?2020919105950

由上图可以看到 pip 支持一下命令

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

--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.

1、install

pip install

You must give at least one requirement to install (see "pip help install")

20201019110054288.png?20209191114

所以这里可以直接使用一下命令实现在线安装

pip install <包名> 或 pip install -r requirements.txt

通过使用== >= <= > <来指定版本,不写则安装最新版

requirements.txt内容格式为:

APScheduler==2.1.2

Django==1.5.4

MySQL-Connector-Python==2.0.1

MySQL-python==1.2.3

PIL==1.1.7

South==1.0.2

django-grappelli==2.6.3

django-pagination==1.0.7

安装本地安装包

pip install <目录>/<文件名> 或 pip install --use-wheel --no-index --find-links=wheelhouse/ <包名>

2、uninstall

卸载安装包

pip uninstall <包名> 或 pip uninstall -r requirements.txt

升级包

pip install -U <包名>

或:pip install <包名> --upgrade

升级pip

pip install -U pip

使用pip安装插件的时候报错:

You are using pip version 8.1.1, however version 9.0.1 is available.

You should consider upgrading via the 'python -m pip install --upgrade pip' command.

升级命令: python -m pip install --upgrade pip

3、freeze

pip freeze,查看已经安装的包及版本信息。

20201019110324208.png?202091911334

导出到指定文件中,如图,注意 “ > ”,文件名称随意。常见按第二种写法。

20201019110357276.png?20209191146

4、list

20201019110431486.png?202091911440

查询可升级的包

pip list -o

20201019110512290.png?202091911522

5、show

显示包所在目录及信息

20201019110546147.png?202091911556

6、search

搜索包

pip search <搜索关键字>

以上就是Python pip 常用命令汇总的详细内容,更多关于Python pip 常用命令的资料请关注脚本之家其它相关文章!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Anaconda Prompt中,可以使用以下命令进行各种操作: 1. 创建、删除和复制虚拟环境: - 创建虚拟环境:conda create --name ENV_NAME - 删除虚拟环境:conda remove --name ENV_NAME --all - 复制虚拟环境:conda create --name NEW_ENV_NAME --clone OLD_ENV_NAME 2. 搜索和安装第三方包: - 搜索包:anaconda search -t conda PACKAGE_NAME - 安装包:conda install --channel CHANNEL_NAME PACKAGE_NAME 或者 pip install PACKAGE_NAME 3. 导出配置文件和通过配置文件安装: - 导出环境配置文件:conda env export > environment.yml - 通过配置文件安装环境:conda env create -f environment.yml 以上是一些常用的Anaconda Prompt命令,供您参考。如果您想了解更多关于Anaconda和Python的知识,可以访问公众号GeodataAnalysis获取更多信息。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [Anaconda常用命令汇总](https://blog.csdn.net/weixin_44785184/article/details/128762486)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Anaconda Prompt 基本命令](https://blog.csdn.net/Yellow_python/article/details/80543851)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值