Python离线安装模块步骤 :https://blog.csdn.net/A1682234/article/details/93847274
然后将其文件放置python安装目录下的Scripts下
在该路径下cmd输入 pip install beautifulsoup4-4.7.1-py3-none-any.whl即可安装
如果报错
D:\Users\EX\AppData\Local\Programs\Python\Python37\Scripts>pip install beautifulsoup4-4.7.1-py3-none-any.whl
Processing d:\users\ex-liuxiaochang001\appdata\local\programs\python\python37\scripts\beautifulsoup4-4.7.1-py3-none-any.whl
Collecting soupsieve>=1.2 (from beautifulsoup4==4.7.1)
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F3050BF1D0>: Failed to
establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/soupsieve/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F3050BF080>: Failed to
establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/soupsieve/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F3050BF6D8>: Failed to
establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/soupsieve/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F3050ABF98>: Failed to
establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/soupsieve/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F3050ABEB8>: Failed to
establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/soupsieve/
Could not find a version that satisfies the requirement soupsieve>=1.2 (from beautifulsoup4==4.7.1) (from versions: )
No matching distribution found for soupsieve>=1.2 (from beautifulsoup4==4.7.1)
说明需要安装soupsieve模块,版本要大于1.2
到https://pypi.org/project/soupsieve/#files找soupsieve,下载存放到python安装目录下的Scripts下
pip install soupsieve-1.9.2-py2.py3-none-any.whl安装成功后
(到https://pypi.org/project/soupsieve/#files找beautifulsoup4,下载存放到python安装目录下的Scripts下)
再安装 pip install beautifulsoup4-4.7.1-py3-none-any.whl
备注:python卸载命令:
格式 : pip uninstall 模块名
举例:
pip uninstall soupsieve
pip uninstall beautifulsoup4