python module offline installation & pip for use

2023-01-20   ES  

1, python module download

1,Pythondownload:Download Python | Python.org
2,Pythonmodule (third party library):  PyPI · The Python Package Index

2, offline update pip

download the latest versionPIP,.whlfilespythonInstallation directory, andpython.exeSame as the same level.

execution:python -m pip install –upgrade xxx(pipThe file name of the wheels, offline upgrade

python -m pip install –upgrade pip(Online upgrade)

Cmd pip –versionView version.

3. Install the Python module

1 Single file module: copy the file directly to $python_dir/Lib

2) Multi -file module, withsetup.py    python setup.py install

3pipInstallation

Online installation:pip install PackageName

offline installation:pip install Bag name.whl

4, PIP commonly used commands

List the installation bag:  pip freeze     pip list –outdated

Install a specific versionpackage:by use==, >=, <=, >, <to specify a version number

$ pip install ‘Markdown<2.0’

$ pip install ‘Markdown>2.0,<2.0.3’

 Pip install SomePackage==1.0.4 

upgrade package to the current latest version, can be used-Uor–upgrade:

upgrade packagepip install -U Markdown   pip install –upgrade packagename

uninstall package:pip uninstall Markdown

Query package (including dependencies)pip show “Markdown”

search package:pip search SomePackage

View package details:pip show requests

Download offline installation packagepip download numpy -d “D:\python\lib\download\all”

Install offline package (automatically find dependencies):pip install scrapy –no-index -f “D:\python\lib\download\scrapy”

Installation from the specified pathrequirement.txtspecified package:pip install –no-index –find-links=specified path -r requirement.txt

5. View project dependencies:

Installationpipreqsorpipdeptree. Switch the path to the root directory of the project that needs to be generatedpipreqs ./

source

Random Posts

Learning notes -Google Browser Developer Tool (1)

HDU — 1114 Question Piggy-BANK

LotusScript basics

java Read the CSV file democsu

Huawei ENSP -VRRP Experiment