Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
270 views
in Technique[技术] by (71.8m points)

Installing MySQL Python on Mac OS X

Long story short, when I write the following:

sudo easy_install MySQL-python

I get the error

EnvironmentError: mysql_config not found

All right, so there are plenty of threads and the like on how to fix that, so I run this code:

export PATH=$PATH:/usr/local/mysql/bin

Then I rerun my sudo code:

sudo easy_install MySQL-python

Then I get the following error.

Setup script exited with error: command 'llvm-gcc-4.2' failed with exit status 1

Google/Stack Overflow that, and I am told to download a GCC package which I did the other day, 200 MB's or there-abouts and still no fix.

At this point I am lost, they say insanity is doing the same thing over and over while expecting a different result. Well, I've continually run the aforementioned code expecting a different result, so I'm not to far away from going insane.

At this point in my Python career, I am new to this, but I am willing to try pretty much anything to get this up and running.

If it helps I am officially running, Mac OS X 10.7.5, and I do have MAMP installed (is that an issue?)

Also, the other day when I was trying all of this for the first time I installed (reinstalled?) MySQL, so I'm really in a tough spot at this point.

Is there a fix?

I've racked my brain, searched Google, read Stack Overflow, and spent hours trying to figure this out to no avail.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here's what I would install, especially if you want to use homebrew:

  • XCode and the command line tools (as suggested by @7stud, @kjti)
  • Install homebrew
  • brew install mysql-connector-c
  • pip install mysql-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...