“SSL certificate verify failed” using pip to install packages

后端 未结 14 1849
野性不改
野性不改 2020-12-05 08:01

I am trying to install the Scrapy package (among others) for python using pip. I have tried doing the installation using python 3 and python 2, I have installed/upgraded the

相关标签:
14条回答
  • 2020-12-05 08:32

    As stated here https://bugs.python.org/issue28150 in previous versions of python Apple supplied the OpenSSL packages but does not anymore.

    Running the command pip install certifi and then pip install Scrapy fixed it for me

    0 讨论(0)
  • 2020-12-05 08:38

    If adding pypi.python.org as a trusted host does not work, you try adding files.pythonhosted.org. For example

    python -m pip install --upgrade --trusted-host files.pythonhosted.org <package-name>
    
    0 讨论(0)
  • 2020-12-05 08:38

    It looks like they are also using pypi.org now. I added the following to %appdata%\pip\pip.ini and was able to download my packages from behind an HTTPS-intercepting proxy:

    trusted-host = pypi.python.org files.pythonhosted.org pypi.org

    0 讨论(0)
  • 2020-12-05 08:39

    It seems that Scrapy fails because installing Twisted fails, which fails because incremental fails. Running pip install --upgrade pip && pip install --upgrade incremental fixed this for me.

    0 讨论(0)
  • 2020-12-05 08:41

    If you're using python3, you can try this too:

    python3 -m pip install --upgrade Scrapy --trusted-host pypi.org --trusted-host files.pythonhosted.org
    
    0 讨论(0)
  • 2020-12-05 08:42

    pip install --trusted-host pypi.python.org autopep8 (any package name)

    This command will add pypi.python.org to the trusted sources and will install all the required package.

    I ran into the error myself and typing this command helped me install all the pip packages of python.

    0 讨论(0)
提交回复
热议问题