You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用pip安装numpy时出现SSL证书验证失败错误求助

Fixing SSL Certificate Error When Installing numpy via pip

Hey there, sorry you're stuck with this frustrating SSL certificate issue while trying to install numpy. Let's walk through practical fixes to get you back to work quickly:

First: Resolve Multiple pip Versions Confusion

You mentioned suspecting conflicting pip versions—let's confirm and clean that up first:

  • Open Command Prompt and run where pip (Windows). This will list all pip executables on your system, so you can spot any extra versions you installed manually.
  • From now on, use python -m pip install numpy instead of just pip install numpy. This ensures you're using the pip that's tied directly to your active Python installation, avoiding any rogue versions you might have installed earlier.
  • If you want to fully reset pip to the Python-built-in version:
    1. Uninstall the current pip with python -m pip uninstall pip
    2. Restore the official bundled pip with python -m ensurepip --upgrade

Fix the SSL Certificate Error

The core issue here is pip failing to verify PyPI's SSL certificate. Try these solutions in order:

1. Temporary Emergency Workaround

If you need numpy installed right away, run this command to bypass SSL verification for PyPI's official domains:

pip install numpy --trusted-host pypi.org --trusted-host files.pythonhosted.org

This tells pip to trust these domains without checking their certificates. Note: This is a quick fix, not a long-term solution.

Pip relies on the certifi library to handle SSL certificates. Updating it often resolves verification issues:

python -m pip install --upgrade certifi

For Windows users, some Python installations include an Install Certificates.command script in the Python installation folder (check the Scripts directory). Running this script will refresh the system's root certificates used by pip.

3. Check Network Proxy Settings

If you're behind a corporate or personal proxy, the proxy might be intercepting SSL traffic with its own certificate. Try:

  • Disabling your proxy temporarily and running pip install numpy again.
  • If you need to keep the proxy, configure pip to trust it (replace your-proxy:port with your actual proxy details):
    pip config set global.proxy http://your-proxy:port
    

4. Verify PyPI Access

You mentioned the PyPI link redirects to an error page—try visiting https://pypi.org/simple/numpy/ in your browser directly. If it loads correctly, the issue is isolated to pip's certificate handling, not network access. If it still errors, check your network firewall settings to ensure PyPI is whitelisted.


内容的提问来源于stack exchange,提问作者BOBTHEBUILDER

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 09:04:01