pip tricks - Serbipunk/notes GitHub Wiki

install

https://pip.pypa.io/en/stable/installing/

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
./python get-pip.py
./python -m pip install numpy

version

pip index versions $PKG_NAME

(venv) MLS ~/git/DeepMat pip index versions pyglet
WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
pyglet (2.0.20)
Available versions: 2.0.20, 2.0.19, 2.0.18, 2.0.17, 2.0.16, 2.0.15, 2.0.14, 2.0.13, 2.0.12, 2.0.11, 2.0.10, 2.0.9, 2.0.8, 2.0.7, 2.0.6, 2.0.5, 2.0.4, 2.0.3, 2.0.2.1, 2.0.2, 2.0.1, 2.0.0, 1.5.31, 1.5.30, 1.5.29, 1.5.28, 1.5.27, 1.5.26, 1.5.24, 1.5.23, 1.5.22, 1.5.21, 1.5.20, 1.5.19, 1.5.18, 1.5.17, 1.5.16, 1.5.15, 1.5.14, 1.5.13, 1.5.11, 1.5.10, 1.5.9, 1.5.8, 1.5.7, 1.5.6, 1.5.5, 1.5.4, 1.5.3, 1.5.2, 1.5.1, 1.5.0, 1.4.11, 1.4.10, 1.4.9, 1.4.8, 1.4.7, 1.4.6, 1.4.5, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.4
(venv) MLS ~/git/DeepMat pip install pyglet==1.5.31,
Looking in indexes: https://miles.bai%40zozo.com:****@zznz.jfrog.io/artifactory/api/pypi/zozonz-pypi/simple, https://pypi.org/simple
Collecting pyglet==1.5.31
  Downloading pyglet-1.5.31-py3-none-any.whl.metadata (7.6 kB)
Downloading pyglet-1.5.31-py3-none-any.whl (1.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 26.3 MB/s eta 0:00:00
Installing collected packages: pyglet
Successfully installed pyglet-1.5.31


install -e

https://github.com/open-mmlab/mmsegmentation/blob/main/docs/en/get_started.md#installation

pip install -v -e .
# '-v' means verbose, or more output
# '-e' means installing a project in editable mode,
# thus any local modifications made to the code will take effect without reinstallation.

build c++ package error

pip install --upgrade setuptools wheel ninja


module ctypes

sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

https://stackoverflow.com/questions/41328451/ssl-module-in-python-is-not-available-when-installing-package-with-pip3

module ssl

linux

apt-get install libffi-dev

https://bugs.python.org/issue30090

windows

install openssl

https://blog.csdn.net/sinat_39808950/article/details/92849441

https://slproweb.com/products/Win32OpenSSL.html

jupyter-notebook

pip install jupyterlab

pip command list

  • install Install packages.
  • download Download packages. 下载whl?
  • 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. 查找远程源
  • cache Inspect and manage pip's wheel cache. 检查并pip
  • wheel Build wheels from your requirements. 从你的requrements中构建wheels
  • hash Compute hashes of package archives. 计算包的摘要值
  • completion A helper command used for command completion. 自动补全?
  • debug Show information useful for debugging. 打开debugging的信息
  • help Show help for commands.

pip list -o

baimr@ubuntu:~$ /home/tengbq/anaconda3/envs/posewithstyle/bin/python -m pip list -o
Package           Version         Latest    Type
----------------- --------------- --------- -----
certifi           2021.5.30       2022.6.15 wheel
numpy             1.19.2          1.19.5    wheel
opencv-python     4.5.5.62        4.6.0.66  wheel
Pillow            8.3.1           8.4.0     wheel
pip               21.2.2          21.3.1    wheel
pytz              2021.3          2022.1    wheel
setuptools        58.0.4          59.6.0    wheel
torch             1.9.0           1.10.2    wheel
torchaudio        0.9.0a0+33b2469 0.10.1    wheel
torchvision       0.10.0          0.11.2    wheel
tqdm              4.62.3          4.64.0    wheel
typing-extensions 3.10.0.2        4.1.1     wheel

py 27 install opencv

pip2 install opencv-python==4.2.0.32

https://stackoverflow.com/a/63355706