How to use pip3 install the latest version package All In One
如何使用pip3安装最新版本包
PIP
$ python -m pip install [options] <requirement specifier> [package-index-options] ...
$ python -m pip install [options] -r <requirements file> [package-index-options] ...
$ python -m pip install [options] [-e] <vcs project url> ...
$ python -m pip install [options] [-e] <local project path> ...
$ python -m pip install [options] <archive url/path> ...
$ python -m pip install SomePackage # latest version ❌ not work ❓ cache bug
$ python -m pip install 'SomePackage==1.0.4' # specific version
$ python -m pip install 'SomePackage>=1.0.4' # minimum version
$ python -m pip install --upgrade SomePackage
# 等价于
$ pip3 install --upgrade SomePackage
https://pip.pypa.io/en/stable/cli/pip_install/
https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-from-pypi
errors
can not install the latest version package ❌
$ sudo pip3 list | grep adafruit
$ sudo pip3 list | grep adafruit-circuitpython-dht
# adafruit-circuitpython-dht 4.0.0
$ sudo apt-get update
$ sudo pip3 install adafruit-circuitpython-dht
$ sudo pip3 list | grep adafruit-circuitpython-dht
# adafruit-circuitpython-dht 4.0.0
solutions
--upgrade
$ sudo pip3 install --upgrade adafruit-circuitpython-dht
$ sudo pip3 list | grep adafruit-circuitpython-dht
# adafruit-circuitpython-dht 4.0.0
pip3 show package_name
$ pip3 show adafruit-circuitpython-dht
$ sudo pip3 show adafruit-circuitpython-dht
Name: adafruit-circuitpython-dht
Version: 4.0.1
Summary: CircuitPython support for DHT11 and DHT22 type temperature/humidity devices
Home-page: None
Author: None
Author-email: Adafruit Industries <[email protected]>
License: MIT
Location: /usr/local/lib/python3.9/dist-packages
Requires: Adafruit-Blinka
Required-by:
specify
a specificversion number
# 指定具体的版本号
$ sudo pip3 install 'adafruit-circuitpython-dhtinstall==4.0.1'
demos
https://github.com/adafruit/Adafruit_CircuitPython_DHT/releases/tag/4.0.1
https://readthedocs.org/projects/adafruit-circuitpython-dht/downloads/pdf/3.2.2/
https://readthedocs.org/projects/adafruit-circuitpython-dht/
https://readthedocs.org/projects/adafruit-circuitpython-dht/downloads/pdf/4.0.1/