pip (package manager) for python

本文详细介绍了Python包管理器pip的安装方法,包括在Unix、MacOSX和Windows系统的具体步骤,以及如何设置pip的配置文件来使用镜像源,加速包的下载与安装。此外,还提供了pip的基本命令,如安装、卸载和搜索Python包的用法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

refrence: https://pip.pypa.io/en/latest/

1. install

for unix:

$sudo apt-get install python-pip

or

$curl -O https://bootstrap.pypa.io/get-pip.py
$python get-pip.py

download get-pip.py link: get-pip.zip

note: you could set mirror of deiban package ftp server to mirrors.163.com debian apt-get sourcelist (mirrors) 

2. basic commands

  • help command
$pip --help
  • install package ($pip install [package-name])
$pip install threadpool

or

$pip install threadpool=1.2.7
  • uninstall package ($pip uninstall [package-name])
$pip uninstall threadpool
  • search  package ($pip search [package-name])
$pip search threadpool

3. configuration mirrors

refrence: http://pip.readthedocs.org/en/docs_rtd/configuration.html

On Unix and Mac OS X the configuration file is: $HOME/.pip/pip.conf
On Windows, the configuration file is: %HOME%\pip\pip.ini
[global]
timeout = 60
trusted-host = pypi.douban.com
index-url = http://pypi.douban.com/simple

 You can set a custom path location for the config file using the environment variable PIP_CONFIG_FILE.

PIP_CONFIG_FILE = C:\pip\pip.ini

转载于:https://www.cnblogs.com/BugQiang/p/4709174.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值