尝试> pip install linkchecker在Windows 7上使用。
> pip install linkchecker在Windows 7
> pip install scrapy
linkchecker。Python 2.7
> pip search linkchecker
Downloading/unpacking linkchecker Getting page https://pypi.python.org/simple/linkchecker/ Could not fetch URL https://pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598) Will skip URL https://pypi.python.org/simple/linkchecker/ when looking for download links for linkchecker Getting page https://pypi.python.org/simple/ Could not fetch URL https://pypi.python.org/simple/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/ (Caused by <class 'http.client.CannotSendRequest'>: Request-sent) Will skip URL https://pypi.python.org/simple/ when looking for download links for linkchecker Cannot fetch index base URL https://pypi.python.org/simple/ URLs to search for versions for linkchecker: * https://pypi.python.org/simple/linkchecker/ Getting page https://pypi.python.org/simple/linkchecker/ Could not fetch URL https://pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598) Will skip URL https://pypi.python.org/simple/linkchecker/ when looking for download links for linkchecker Could not find any downloads that satisfy the requirement linkchecker Cleaning up... Removing temporary dir C:\Users\jcook\AppData\Local\Temp\pip_build_jcook... No distributions at all found for linkchecker Exception information: Traceback (most recent call last): File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main status = self.run(options, args) File "C:\Python34\lib\site-packages\pip\commands\install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "C:\Python34\lib\site-packages\pip\req.py", line 1177, in prepare_files url = finder.find_requirement(req_to_install, upgrade=self.upgrade) File "C:\Python34\lib\site-packages\pip\index.py", line 277, in find_requirement raise DistributionNotFound('No distributions at all found for %s' % req) pip.exceptions.DistributionNotFound: No distributions at all found for linkchecker
你可以使用以下参数指定证书:
pip --cert /etc/ssl/certs/FOO_Root_CA.pem install linkchecker
请参阅:文档»参考指南»点
如果指定你公司的根证书无效,则可能无法使用cURL:http : //curl.haxx.se/ca/cacert.pem
http : //curl.haxx.se/ca/cacert.pem
你必须使用PEM文件而不是CRT文件。如果你有CRT文件,则需要将其转换为PEM。注释中有报告说,该报告现在可用于CRT文件,但我尚未验证。
你可以通过将pypi.org和设置files.pythonhosted.org为受信任的主机来忽略SSL错误。
$ pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package_name>
注意:在2018年4月的某个时候,Python软件包索引从迁移pypi.python.org到pypi.org。这意味着使用旧域的“受信任主机”命令不再起作用。
pypi.python.org
pypi.org
永久修复
从pip 10.0版本发布以来,你应该能够通过pip自我升级来永久解决此问题:
$ pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pip setuptools
或者通过重新安装以获得最新版本:
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
(…,然后get-pip.py与相关的Python解释器一起运行)。
get-pip.py
pip install <otherpackage>应该在此之后工作。如果没有,那么你将需要做更多的事情,如下所述。
pip install <otherpackage>
你可能需要将受信任的主机和代理添加到配置文件。
pip.ini(Windows)或pip.conf(unix)
[global] trusted-host = pypi.python.org pypi.org files.pythonhosted.org
替代解决方案(安全程度较低)
大多数答案可能会带来安全问题。
有助于轻松安装大多数python软件包的两种解决方法是:
easy_install
<package_name>
Wheel
pip install wheel_package_name.whl