python使用pip安装beautifulsoup4总是抛异常安装不了---
D:\Python27\Scripts>pip install beautifulsoup4
Collecting beautifulsoup4
D:\Python27\lib\site-packages\pip_vendor\requests\packages\urllib3\util\ssl_.py:318: SNIMissi
TPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not avail
tform. This may cause the server to present an incorrect TLS certificate, which can cause vali
You can upgrade to a newer version of Python to solve this. For more information, see https:/
docs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
D:\Python27\lib\site-packages\pip_vendor\requests\packages\urllib3\util\ssl_.py:122: Insecure
A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropr
ause certain SSL connections to fail. You can upgrade to a newer version of Python to solve th
ormation, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading beautifulsoup4-4.4.1-py2-none-any.whl (81kB)
Exception:
Traceback (most recent call last):
File "D:\Python27\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "D:\Python27\lib\site-packages\pip\commands\install.py", line 299, in run
requirement_set.prepare_files(finder)
File "D:\Python27\lib\site-packages\pip\req\req_set.py", line 370, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "D:\Python27\lib\site-packages\pip\req\req_set.py", line 587, in prepare_file
session=self.session, hashes=hashes)
File "D:\Python27\lib\site-packages\pip\download.py", line 810, in unpack_url
hashes=hashes
File "D:\Python27\lib\site-packages\pip\download.py", line 649, in unpack_http_url
hashes)
File "D:\Python27\lib\site-packages\pip\download.py", line 871, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "D:\Python27\lib\site-packages\pip\download.py", line 595, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "D:\Python27\lib\site-packages\pip\utils\hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "D:\Python27\lib\site-packages\pip\download.py", line 563, in written_chunks
for chunk in chunks:
File "D:\Python27\lib\site-packages\pip\utils\ui.py", line 139, in iter
for x in it:
File "D:\Python27\lib\site-packages\pip\download.py", line 552, in resp_read
decode_content=False):
File "D:\Python27\lib\site-packages\pip_vendor\requests\packages\urllib3\response.py", line
data = self.read(amt=amt, decode_content=decode_content)
File "D:\Python27\lib\site-packages\pip_vendor\requests\packages\urllib3\response.py", line
flush_decoder = True
File "D:\Python27\lib\contextlib.py", line 35, in __exit_
self.gen.throw(type, value, traceback)
File "D:\Python27\lib\site-packages\pip_vendor\requests\packages\urllib3\response.py", line
catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
你是不是以前下载过,可以先把以前下载的缓存删了从新下载安装
重装一下requests试试?
pip install requests[security]
我到官网下载了离线包解决了,然后手动安装