pip install python package to the specified path

We usually install python libraries and use them directly

pip install ****

Where **** represents the name of the dependent library or package installed.
But in this way, the system will be installed to the default location,
so you need to set the installation directory to the corresponding installed python.
Use this command

pip3 install bs4 --target=D:\Python37\Lib\site-packages

pip2 or pip3: package management system

install: install

bs4: Python packages to be installed, such as requests

Specify the installation directory: –target=D:\Python37\Lib\site-packages path is your python installation location

Guess you like

Origin blog.csdn.net/p715306030/article/details/113394513