MySQL-python安装Mac [英] MySQL-python install Mac

查看:111
本文介绍了MySQL-python安装Mac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Mac上安装适用于Python的MySQLdb,以便可以对其进行测试.我正在运行 OS X 10.11.4 .我看过的任何地方都说要使用

I am trying to install MySQLdb for Python on my mac so I can use it to test. I am running OS X 10.11.4. Everywhere I look says to use

pip install MySQL-python

每次我这样做时,我都会收到错误提示.

Every time I do that I get an error saying.

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/4s/4wwhr6zj59sf0c4qkprqbsp80000gn/T/pip-build-042_KK/MySQL-python/

我在打开新外壳时正好在运行命令,是否应该更改路径?

I am running the command just right when I open a new shell, should I change the path?

推荐答案

使用自制软件brew install mysql-connector-c安装mysql连接器,然后使用pip pip install mysql-python安装mysql-python或尝试使用PyMySQL其纯Python客户端库,您可以使用pip install PyMySQL并升级setuptools. pip install --upgrade setuptools.

install mysql connector using homebrew brew install mysql-connector-c then install mysql-python using pip pip install mysql-python or try PyMySQL its a pure python client library, you can install using pip install PyMySQL and upgrade setuptools. pip install --upgrade setuptools.

这篇关于MySQL-python安装Mac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆