【问题标题】:Can not install NumPy using pip in Python3, Ubuntu14.04无法在 Python3、Ubuntu14.04 中使用 pip 安装 NumPy
【发布时间】:2017-03-21 08:33:01
【问题描述】:

我在尝试 pip install NumPy 时收到此错误:

pip 配置了需要 TLS/SSL 的位置,但是 Python 中的 ssl 模块不可用。

Collecting numpy

Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: 

Can't connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy

有人知道怎么解决吗?

【问题讨论】:

  • 请提供pip version 命令:pip -V
  • 尝试使用 apt-get 安装 libssl-dev ...
  • @vanloc pip 9.0.1 来自 /home/nguyennguyenquochuy/tutorial-env/lib/python3.6/site-packages (python 3.6)
  • @GerardRozsavolgyi 它不起作用。

标签: python python-3.x numpy ssl pip


【解决方案1】:

解决方案 1: 也许试试sudo -E:

 -E          The -E (preserve environment) option indicates to the secu‐
             rity policy that the user wishes to preserve their existing
             environment variables.  The security policy may return an
             error if the -E option is specified and the user does not
             have permission to preserve the environment.

解决方案 2:代理可能会对此产生影响。所以:

sudo pip --proxy=http://username:password@proxyURL:portNumber install your-package

【讨论】:

    【解决方案2】:

    您可能遇到一两个问题:

    首先您需要使用以下命令安装 OpenSSL:

    sudo apt-get install openssl
    

    其次,确保您的 python 版本是针对 SSL 编译的。我相信您安装了预编译版本。在这种情况下,它会没事的。否则你需要在构建你的 python 之前安装 libssl-dev

    【讨论】:

    • 我之前安装了 libssl-dev 和 openssl,但是当我尝试使用 pip install numpy 时,它仍然无法正常工作。
    猜你喜欢
    • 2013-06-30
    • 2019-12-22
    • 1970-01-01
    • 2017-06-15
    • 2020-02-20
    • 2019-10-05
    • 1970-01-01
    • 2019-06-17
    • 2020-09-08
    相关资源
    最近更新 更多