Package management mechanism pip3

pip3

Install pip3

  • Install pip3
apt install python3-pip
yum install python3-pip

Commands from the warehouse

  • Query warehouse information
// 获取默认pip3源
pip3 config get global.index-url
  • Query all software packages
查询已经安装的所有软件包
pip3 list

Commands from the package

  • Query other information based on the package name
查询对应的安装包(zipp)的信息
pip3 show zipp
  • Query where the latter files of the software package can be obtained
pip3 search zipp
网址 : https://pypi.org/ https://github.com/

Commands related to starting from a file

好像pip3 中并不在乎文件列表和位置
因为 这些文件不能独立执行,他们要被 python解释.
所以python好像将文件的概念给弱化了.

Local database related

  • Install uninstall package
安装包
pip3 install xxx 

# 指定版本
pip3 install django==2.2.2

# 不使用默认pip3源 ,  指定pip3源
pip3 install requests      -i https://pypi.tuna.tsinghua.edu.cn/simple 

卸载包
pip3 uninstall xxx

# 输出安装的包列表到文件
pip3 freeze > requirements.txt
#以该文件安装包
pip3 install -r requirements.txt
  • cache
下载包
pip3 download zipp
  • local database file
pip3 show -f zipp

/usr/lib/python3/dist-packages/zipp-1.0.0.egg-info
/usr/lib/python3/dist-packages/zipp.py
/usr/lib/python3/dist-packages/__pycache__/zipp.cpython-310.pyc
/usr/lib/python3/dist-packages/zipp-1.0.0.egg-info/PKG-INFO
/usr/lib/python3/dist-packages/zipp-1.0.0.egg-info/dependency_links.txt
/usr/lib/python3/dist-packages/zipp-1.0.0.egg-info/requires.txt
/usr/lib/python3/dist-packages/zipp-1.0.0.egg-info/top_level.txt
/usr/share/doc/python3-zipp
/usr/share/doc/python3-zipp/changelog.Debian.gz
/usr/share/doc/python3-zipp/copyright
/var/lib/dpkg/info/python3-zipp.list
/var/lib/dpkg/info/python3-zipp.md5sums
/var/lib/dpkg/info/python3-zipp.postinst
/var/lib/dpkg/info/python3-zipp.prerm

pip3 warehouse configuration

  • Client warehouse configuration

pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple
pip3 config set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple
~/.pip/pip.conf
[global]
timeout=6000
index-url = https://mirrors.aliyun.com/pypi/simple
#extra-index-url = https://pypi.python.org/pypi

[install]
trusted-host = mirrors.aliyun.com  # trusted-host 此参数是为了避免麻烦,否则使用的时候可能会提示不受信任


INSTALL OPTIONS
       pip install installs packages from:
PyPI (a.k.a. The Cheeseshop) and other indexes, using requirements specifiers.

          • VCS project urls.

          • Local project directories.

          • Local or remote source archives

          • Local wheel directories (python-pip-whl installs its wheels in /usr/share/ python-wheels and they can be locally installed by pip using --find-links)

Guess you like

Origin blog.csdn.net/u011011827/article/details/132253301