在conda环境中使用pip时出现SSL证书问题

时间:2019-09-14 18:01:34

标签: python pip anaconda conda

OC:MS Windows 10 Professional

conda:4.7.11

点数:19.2.2

python:3.7.4

CUDA:10.1.168

需要在隔离的conda环境中安装pycuda。我按照conda docs中的说明创建了新的环境:

conda create -n cudaenv
conda install -n cudaenv cudatoolkit

然后安装点子:

conda install -n cudaenv pip
conda activate cudaenv

并尝试在其中安装pycuda:

pip install pycuda-2019.1.2+cuda101-cp37-cp37m-win_amd64.whl

...然后发生了错误

(cudaenv) D:\Downloads>**pip install pycuda-2019.1.2+cuda101-cp37-cp37m-win_amd64.whl**f
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Processing d:\downloads\pycuda-2019.1.2+cuda101-cp37-cp37m-win_amd64.whl
Collecting appdirs>=1.4.0 (from pycuda==2019.1.2+cuda101)
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/appdirs/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/appdirs/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/appdirs/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/appdirs/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/appdirs/
  Could not fetch URL https://pypi.org/simple/appdirs/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/appdirs/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  ERROR: Could not find a version that satisfies the requirement appdirs>=1.4.0 (from pycuda==2019.1.2+cuda101) (from versions: none)
ERROR: No matching distribution found for appdirs>=1.4.0 (from pycuda==2019.1.2+cuda101)
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

因此,尽管我尝试从wheel安装pycuda,但还是收到SSL错误。更重要的是,标记--trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org无济于事,我也遇到同样的错误。

在基本环境中,pip正常工作。有人可以说,这是什么意思?

更新:似乎试图从远程存储库获取appdir,但是由于SSL问题而失败... --trusted-host仍然无济于事。 Pip版本是最新版本。

0 个答案:

没有答案