mysql安装write config,由于缺少mysql_config在OSX上安装MySQL-python失败

I'm attempting to install MySQL-python on OSX so a program I'm writing can talk to our work database to run and get back query results.

I've run into this error explaining that there is a missing mysql_config somewhere. I've come across some other StackOverflow answers but they are geared toward Linux environments.

I've also done a brew install mysql but brew link mysql is failing. I suspect the issue might being right here.

Collecting mysql-python

/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

InsecurePlatformWarning

Downloading MySQL-python-1.2.5.zip (108kB)

100% |████████████████████████████████| 110kB 1.8MB/s

Complete output from command python setup.py egg_info:

sh: mysql_config: command not found

Traceback (most recent call last):

File "", line 20, in

File "/private/tmp/pip-build-ev74Js/mysql-python/setup.py", line 17, in

metadata, options = get_config()

File "setup_posix.py", line 43, in get_config

libs = mysql_config("libs_r")

File "setup_posix.py", line 25, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-ev74Js/mysql-python

解决方案

It appears you don't have write permissions for /usr/local, resulting in homebrew failing to link. If you're on OS X 10.11+ there's a good chance that it's reset all the permissions, which you need to change in order to remedy the issue; first try letting homebrew fix things:

Troubleshooting Homebrew:

Run brew update (twice).

Run brew doctor and fix all the warnings.

Take Ownership:

If things fail with permissions errors, check the permissions in /usr/local, or perhaps use:

sudo chown -R $(whoami) /usr/local

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值