MacOS Mojave 10.14.4 安装 MySQLdb 报错处理

MacOS Mojave 10.14.4 上安装 MySQL-python 恶心到吐,以前 MacOS series 版本时安装过,但没有这么痛苦。为以后不再被恶心到,还是记录一下吧。

我们安装 MySQL-python 之前应该都已经安装过 mysql 了,这里就不记录了。

执行 pip install MySQL-python

第一种报错:
_mysql.c:44:10: fatal error: ‘my_config.h‘ file not found
#include "my_config.h"
^~~~~
1 error generated.
error: command ‘cc‘ failed with exit status 1
解决方法:

brew install mysql-connector-c

上面的问题解决了,会再报第二种错:

ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command ‘cc‘ failed with exit status 1

解决方法:

echo ‘export PATH="/usr/local/opt/[email protected]/bin:/usr/local/opt/[email protected]/bin:$PATH"‘ >> ~/.bash_profile
echo ‘export LDFLAGS="-L/usr/local/opt/[email protected]/lib -L/usr/local/opt/[email protected]/lib/"‘ >> ~/.bash_profile
echo ‘export CPPFLAGS="-I/usr/local/opt/[email protected]/include -I/usr/local/opt/[email protected]/include"‘ >> ~/.bash_profile
echo ‘export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"‘ >> ~/.bash_profile
source ~/.bash_profile

再执行 pip install MySQL-python
OK

原文地址:https://blog.51cto.com/784687488/2386161

时间: 2024-08-03 08:39:24

MacOS Mojave 10.14.4 安装 MySQLdb 报错处理的相关文章

VMWare 14.1 15 Pro 安装 macOS Mojave 10.14.1系统 遇到的问题解决方案

安装环境WIN10VMware Workstation Pro 15.0.0 Build 10134415工具准备1.VMware Workstation Pro 15.0.0 Build 10134415官网下载地址:http://download3.vmware.com/software/wkst/file/VMware-workstation-full-15.0.0-10134415.exe给几个序列号:AC11H-4HZ05-08EDQ-APQGX-YCUC8ZG780-8EZ9M-M8

win10 64位 python3.6 django1.11 MysqlDB No module named 'MySQLdb' 安装MysqlDB报错 Microsoft Visual C++ 14.0 is required

在python3.6中操作数据库,再按python2.7安装MySQLdb进行数据库连接已经不可用了,我使用的是另外一个方法:PyMySQL,安装好之后还是不能直接连接MySQL的,启动项目后报No module named 'MySQLdb' 解决方案: 在项目的__init__()文件中添加如下代码: import pymysql pymysql.install_as_MySQLdb() 这时再次启动项目正常 win10 64位 python3.6 django1.11 MysqlDB No

macOS Mojave 10.14 正式版下载 – 苹果Mac系统升级程序

Apple在前段时间的WWDC 发布会上宣布了最新的 macOS Mojave 10.14 操作系统,经过一段时间测试之后于9.25日迎来最终的正式版下载. macOS Mojave 10.14 系统新增了深夜模式界面.桌面文件自动归类整理成堆栈.更强大的 Finder 图片浏览.Quick Look 预览可编辑/标记.全新设计的 Mac AppStore.更丰富的截图功能.更注重隐私保护的 Safari.手机摄像头"接力".HomeKit 智能家居支持等一系列新功能 macOS Mo

上一封 下一封 APPLE-SA-2019-3-25-2 macOS Mojave 10.14.4,Security Update 2019-002 High Sierra, Security Update 2019-002 Sierra

APPLE-SA-2019-3-25-2 macOS Mojave 10.14.4, Security Update2019-002 High Sierra, Security Update 2019-002 Sierra macOS Mojave 10.14.4, Security Update 2019-002 High Sierra,Security Update 2019-002 Sierra are now available andaddresses the following: A

macOS Mojave 10.14.4 官网正式版

软件介绍 macOS Mojave 10.14.4 官网正式版点击下载 macOS Mojave 10.14.4 官网正式版是目前最受欢迎的Mac电脑的最新版本操作系统,专为Mac电脑打造而成,采用了软硬件协同设计,能帮助用户得心应手地处理各种事情.最近macOS Mojave经过一段时间的测试检测也更新到了10.14.4版本,下面就给大家介绍一下更新内容. 版本更新 黑暗模式 为用户的Mac电脑体验一个戏剧性的新外观,把用户的内容放在前面和中间,而控件退到背景中. 享受新应用程序的设计,让用户

2019.9.3 随笔(4):在VMware中安装macOS Mojave 10.14

参考文章: https://baijiahao.baidu.com/s?id=1631471394352806511&wfr=spider&for=pc https://blog.csdn.net/silentbird520/article/details/96039415 https://www.52pojie.cn/thread-804000-1-1.html https://blog.csdn.net/guomainet309/article/details/52456302 一.安

python3.7.3使用pip安装mysqldb报错,3.7.3后改为pymysql

(xiao) [[email protected] web]$ pip install mysqldbCollecting mysqldbCould not find a version that satisfies the requirement mysqldb (from versions: )No matching distribution found for mysqldb(xiao) [[email protected] web]$ pip install pymysqlCollect

pip安装ujson报错: error:Microsoft Visual C++ 14.0 is required

在win10上pip安装ujson报错 之前一直用的是mac本,但由于疫情问题,最近不得不用win10系统来进行python开发,在使用pip安装依赖包ujson时,遇到了问题,如下: (custom_itsm) D:\DEVELOP\items\hn_test>pip install ujson DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python

安装STS报错(三)

this指针只能在一个类的成员函数中调用,它表示当前对象的地址.下面是一个例子: void Date::setMonth( int mn ) { month = mn; // 这三句是等价的 this->month = mn; (*this).month = mn; } 1. this只能在成员函数中使用. 全局函数,静态函数都不能使用this. 实际上,成员函数默认第一个参数为T* const register this. 如: class A{public: int func(int p){