Skip to main content
 首页 » 编程设计

python之为什么 pip 会阻止安装可能不安全和无法验证的文件

2025年05月04日7TianFang

我尝试使用 pip 安装 pybgpdump,但 pip 抛出以下错误。

pip install pybgpdump 
Downloading/unpacking pybgpdump 
  You are installing a potentially insecure and unverifiable file. Future versions of pip will default to disallowing insecure files. 
  Error <urlopen error [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed> while getting https://jon.oberheide.org/pybgpdump/downloads/pybgpdump-0.2.tar.gz (from https://jon.oberheide.org/pybgpdump/) 
Cleaning up.. 

为什么 pip 会尝试验证 pybgpdump 包?

安全文件和不安全文件有什么区别?

请您参考如下方法:

因为从pip 1.3版本开始,https是默认协议(protocol)。

在CHANGES.txt :

**1.3 (2013-03-07)** 
 
* SSL Cert Verification; Make https the default for PyPI access. 
  Thanks James Cleveland, Giovanni Bajo, Marcus Smith and many others (:pull:`791`, CVE-2013-1629). 

因为pybgpdump托管在外部服务器 ( https://jon.oberheide.org/pybgpdump/ ) 上,您没有安装正确的证书。

另请注意,pypi 包索引仅包含 pybgpdump 的 0.1 版本,最新版本为 0.2