簡體   English   中英

無法在 Python3、Ubuntu14.04 中使用 pip 安裝 NumPy

[英]Can not install NumPy using pip in Python3, Ubuntu14.04

嘗試 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

有誰知道如何解決這個問題?

您可能會遇到一兩個問題:

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

sudo apt-get install openssl

其次確保您的python 版本針對SSL 編譯。 我相信您安裝了預編譯版本。 在這種情況下,它會很好。 否則,您還需要在構建 python 之前安裝 libssl-dev

解決方案 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM