python - “pip 配置了需要 TLS/SSL 的位置,但是 Python 中的 ssl 模块不可用”
问题描述
我有 anaconda 包并运行 Spyder。这是我的系统信息:
anaconda 2018.12 py37_0
Python 3.7.1
pip 18.1
Dell Inspiron 13 7000 64-bit
我无法在命令提示符下使用 pip 安装任何东西。例如,我在尝试安装 numpy 时得到以下信息(我已经通过 anaconda 获得了):
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Requirement already satisfied: numpy in c:\users\uday rallabhandi\anaconda3\lib\site-packages (1.15.4)
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
请帮助我理解为什么会这样。
解决方案
这是我在带有 Anaconda 的 Windows 10 上纠正错误的过程:
- 在我的环境变量中添加了以下路径:
- /AppData/Local/Continuum/Anaconda3
- /AppData/Local/Continuum/Anaconda3/Scripts
- /AppData/Local/Continuum/Anaconda3/库
- /AppData/Local/Continuum/Anaconda3/Library/Bin
在这个阶段,错误消息仍然存在。
- 从 Anaconda Prompt,我安装了最新版本的 pip:
python -m pip install --upgrade pip
这似乎纠正了 DLL 冲突。
推荐阅读
- sql - 从 >8000 字符 SQL 链接服务器查询的结果创建表
- java - JNI 错误:一个类已由 Java 运行时的更新版本编译
- php - 在 WooCommerce 变体价格上显示特定的选定产品属性
- c++ - 使用私有对象变量时如何稍后初始化数组(初始化对象后)
- vbscript - RND 查询在 Access 中工作,但在 ASP 中不工作
- turing-machines - 如何证明 Turinh 机器无法解决的问题?
- javascript - 在 js 动画中通过鼠标滚轮加速 css 的 skew()
- python - 如何正确循环内容
- angular - Angular 7 - 嵌套表单触摸标志干扰父表单按钮单击
- javascript - 如何在 axios 中为 POST - multipart/form-data 设置 MIME 类型?