xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

How to use pip3 install the latest version package All In One

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/

image

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

image

solutions

  1. --upgrade
$ sudo pip3 install --upgrade adafruit-circuitpython-dht

$ sudo pip3 list | grep adafruit-circuitpython-dht
# adafruit-circuitpython-dht       4.0.0

image

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 <circuitpython@adafruit.com>
License: MIT
Location: /usr/local/lib/python3.9/dist-packages
Requires: Adafruit-Blinka
Required-by:

image

  1. specify a specific version number
# 指定具体的版本号
$ sudo pip3 install 'adafruit-circuitpython-dhtinstall==4.0.1'

demos

$ sudo pip3 install --upgrade adafruit-circuitpython-dht

$ sudo pip3 list | grep adafruit-circuitpython-dht
# adafruit-circuitpython-dht       4.0.0

$ ./dht11.py 
开始读取温湿度 🌡 💦
🌡 华氏温度 Temp: 77.0 °F 
🌡 摄氏温度 Temp: 25.0 °C
💦 Humidity: 60% 
clear 🚀

image

https://stackoverflow.com/questions/74167188/get-rid-of-lost-access-to-message-queue-in-a-simple-python-script/76264450#76264450

https://www.cnblogs.com/xgqfrms/p/17406481.html#5177591

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

Adafruit_CircuitPython_DHT

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/

pip3

$ pip3 --help
Usage:   
  pip3 <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  inspect                     Inspect the python environment.
  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.
  index                       Inspect information available from package indexes.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  debug                       Show information useful for debugging.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --debug                     Let unhandled exceptions propagate outside the main subroutine, instead of logging them to stderr.
  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  --require-virtualenv        Allow pip to only run in a virtual environment; exit with an error otherwise.
  --python <python>           Run pip with the specified Python interpreter.
  -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>                Path to a verbose appending log.
  --no-input                  Disable prompting for input.
  --keyring-provider <keyring_provider>
                              Enable the credential lookup via the keyring library if user input is allowed. Specify which mechanism to use [disabled, import, subprocess]. (default: disabled)
  --proxy <proxy>             Specify a proxy in the form scheme://[user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
  --trusted-host <hostname>   Mark this host or host:port pair as trusted, even though it does not have valid or any HTTPS.
  --cert <path>               Path to PEM-encoded CA certificate bundle. If provided, overrides the default. See 'SSL Certificate Verification' in pip documentation for more information.
  --client-cert <path>        Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
  --cache-dir <dir>           Store the cache data in <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.
  --no-color                  Suppress colored output.
  --no-python-version-warning
                              Silence deprecation warnings for upcoming unsupported Pythons.
  --use-feature <feature>     Enable new functionality, that may be backward incompatible.
  --use-deprecated <feature>  Enable deprecated functionality, that will be removed in the future.

pip cheatsheet

http://dcjtech.info/wp-content/uploads/2015/10/Pip-Cheatsheet.pdf

refs

https://note.nkmk.me/en/python-pip-usage/

https://stackoverflow.com/questions/50316939/pip-install-the-latest-version



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-05-17 10:20  xgqfrms  阅读(61)  评论(1编辑  收藏  举报