Windows Pip:无法获取pypi的URL并发出ssl证书确认

Windows Pip:无法获取pypi的URL并发出ssl证书确认,windows,python-3.x,pip,easy-install,Windows,Python 3.x,Pip,Easy Install,我最近刚刚安装了运行pip9.0.1的python3.6.1,每当我尝试安装软件包时,都会出现以下错误: pip install cx_Oracle Collecting cx_Oracle Could not fetch URL https://pypi.python.org/simple/cx-oracle/: There was a pro blem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] ce

我最近刚刚安装了运行pip9.0.1的python3.6.1,每当我尝试安装软件包时,都会出现以下错误:

pip install cx_Oracle

Collecting cx_Oracle
  Could not fetch URL https://pypi.python.org/simple/cx-oracle/: There was a pro
blem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificat
e verify failed (_ssl.c:749) - skipping
  Could not find a version that satisfies the requirement cx_Oracle (from versio
ns: )
No matching distribution found for cx_Oracle
由于证书有问题,我尝试这样做:

pip install --trusted-host pypi.python.org pytest-xdist

Collecting pytest-xdist
  Downloading pytest-xdist-1.15.0.tar.gz (87kB)
    100% |████████████████████████████████| 92kB 1.8MB/s
    Complete output from command python setup.py egg_info:
    Download error on https://pypi.python.org/simple/setuptools_scm/: [SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages m
ay not be found!
    Download error on https://pypi.python.org/simple/setuptools-scm/: [SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages m
ay not be found!
    Couldn't find index page for 'setuptools_scm' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_
FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found
!
    No local packages or working download links found for setuptools_scm
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\ALEX~1.CAU\AppData\Local\Temp\pip-build-7vo4jump\pytest-xdi
st\setup.py", line 37, in <module>
        'Programming Language :: Python :: 3',
      File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\dis
tutils\core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\setuptools\dist.py", line 315, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\setuptools\dist.py", line 361, in fetch_build_eggs
        replace_conflicting=True,
      File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\pkg_resources\__init__.py", line 850, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\pkg_resources\__init__.py", line 1122, in best_match
        return self.obtain(req, installer)
      File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\pkg_resources\__init__.py", line 1134, in obtain
        return installer(requirement)
      File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\setuptools\dist.py", line 429, in fetch_build_egg
        return cmd.easy_install(req)
      File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\setuptools\command\easy_install.py", line 659, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Re
quirement.parse('setuptools_scm')

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ALEX~1.C
AU\AppData\Local\Temp\pip-build-7vo4jump\pytest-xdist\
类似stackoverflow问题的许多答案都建议更改代理设置。我不是在代理后面工作,而是在VPN后面工作。我在安装软件包时遇到了与NodeJS/react/npm非常类似的问题,所有建议都是更改代理设置。我最终通过删除存储代理设置的文件来解决问题

我很难找到一个为python/pip提供相同功能的文件,我想知道是否有人知道它在Windows7上的位置?我也很想听到关于如何解决这个令人沮丧的问题的其他建议


Alex

我的解决方案是首先执行pip安装-可信主机pypi.python.org setuptools\u scm,然后安装pytest xdist

例如,-trusted host pypi.python.org选项适用于除pytest xdist之外的所有需求。提示是,这个特定的包抱怨

Couldn't find index page for 'setuptools_scm' (maybe misspelled?)

对于您提出的问题,这不是一个完整的答案,但您的输出与我刚才处理的内容类似,因此这些是我的笔记。

在使用python2.7的Mac上,我遇到了类似的pip安装错误,抱怨确认ssl证书时出现问题。这适用于不同的软件包,但我的解决方案可能对其他人有用。我的家人使用的旧Mac电脑跟不上时代。当我更新了自制软件,升级了我们已经安装的brew软件包,并使用brew重新链接python2后,问题就解决了

brew update
brew upgrade
brew install python2
brew link --overwrite python@2

我会给你最好的答案,因为你似乎提供了一个有用的解决方案。最后切换到Mac,不再有这个问题!!!
brew update
brew upgrade
brew install python2
brew link --overwrite python@2