python - '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书
问题描述
首要问题:
我正在使用 MackBook Pro 在 PyCharm 中运行连接到 MySQL 的 python3 程序,当我运行收到的程序时
ModuleNotFoundError: No module named 'mysql
对于第 1 行,它是
import mysql.connector
我试过的:
我尝试使用安装mysqlpip
pip3 install mysql-connector-python
新问题:
在执行时
pip install mysql-connector-python
已收到:
Could not fetch URL https://pypi.org/simple/mysql-connector-python/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/mysql-connector-python/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))) - skipping
Could not find a version that satisfies the requirement mysql-connector-python (from versions: )
No matching distribution found for mysql-connector-python
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(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))) - skipping"
解决方案
推荐阅读
- reactjs - React Native fbsdk 0.8.0 版本 crash the RN project for iOS
- chatbot - Dialogflow 使用 Rest api 访问代理历史记录
- javascript - SharePoint JavaScript 读取富文本多行字段的值
- python - 如何在填充缺失日期的同时反向融化分类变量列?熊猫
- node.js - 为什么当余数 4.677 减去 0.001 结果是 4.67599?
- ios - 从另一个没有情节提要的类或方法访问 TextField
- android - 如何从我的证书中受益以进行更新
- c++ - QWidget closeEvent(...) 没有被 QProcess::terminate() 调用
- syntax - ocaml:多个参数函数的基本语法
- c# - c# 中的金雅拓第三方 dll 引用