You ever take it off any sweet jumps?
February 21st, 2009
 
-->

Python-MySQL Connections on Mac OS

Update: This entry has been updated for Snow Leopard.

In all of Mac-dom, there are few experiences more painful than trying to get Python tools to talk to a MySQL database. Installing MySQL itself is easy enough – Sun provides a binary package installer. Python 2.5 comes with Mac OS X. If you enable Apache and PHP, your PHP scripts will talk to your installed MySQL databases just fine, since PHP comes bundled with a MySQL database connector. But try to get up and running with Django, TurboGears, or any other Python package where MySQL database access could be useful (or needed), and you’re in for a world of hurt.

Update: I finally did manage to get Python and MySQL playing nice together, but it took a few more contortions beyond what’s described in the recipes found scattered around the interwebs. I’ve added my solution at the end of this post.

First, the official mysql-python package available at SourceForge does not offer a .pkg installer. No problem – we can build from source. Ah, but the source code is developed for and tested on Linux, and has apparently never been test-built on Mac OS X by the maintainers.  The usual

1
python setup.py buildsudo python setup.py install

will not work. Search for “mac python mysql binding” and you’ll find dozens (hundreds?) of sites describing processes you can go through to edit a few of the source files so they’ll compile on OS X. Some of them work, some of them don’t. I spent three hours yesterday trying one recipe after another. I tried mysql-python versions 1.2.1, 1.2.2, and the beta version of 1.2.3. The recipes that would get python-mysql to build and install still failed when I attempted import MySQLdb from within Python. Complaints of the same problem largely go unanswered – presumably people just give up.

Python’s easy_install is no help either – it chokes because it can’t find the path to mysql_config, and there’s no way to hand it one (that I can tell.)

Judging by timestamps on old blog entries, this sorry state of affairs has been going on for years. Developers wasting hours trying to get a simple db connector to compile… but it never seems to get fixed. “It’s open source,” you say – “Fix it and contribute your fixes back to the community.” I would. I’d love to. But I can’t get the damn thing to compile and install cleanly, despite all the recipes out there. Even seasoned developers in #django  offer responses like “Yeah, I remember that was a huge PITA. I eventually got it to compile, but don’t remember how.”

There is another option – a precompiled python-mysql connector does exist, but only available through the MacPorts project, which aims to remove some of the pain of installing common *nix tools on OS X. But there’s a rub – the connector available through MacPorts only ships with the complete MacPorts version of MySQL. So unless you want to avoid the confusion of having two RDBMs running at the same time, you’ll need to rip the official MySQL (and its startup item) out of your system before you begin. Of course, if you’ve already got data stored in those databases, you’ll need to back up that data first. Even then, getting the MacPorts version of MySQL up and running is no picnic either. You’re still going to end up with a lot of post-install configuration, tweaking, permissions issues, etc. This shouldn’t be necessary. There should be an installer that works with Sun’s stock MySQL dist and Apple’s bundled python. You shouldn’t need to alter your whole system config for this one little piece.

You have to wonder how many people have gotten curious about Python development, hit their heads on this brick wall, and thrown up their hands. As Keenan Thomson would say, “FIX IT!!!”

Someone out there knows how to create a mysql-python package that’s as easy to install as MySQL itself. We need to identify that person, offer them some bread for their trouble, and get this problem fixed for once and for all.

Note: I am no longer running a tipjar to get this work done. For whatever reason, we’re not seeing many contributions, and I’ve got the problem solved now (painful as it was). If you’d like to take up the mantle, go for it.

On the other hand, if you’re a web developer who’s tired of banging your head against this ridiculous wall, please leave a few bucks for the developer who promises to solve the problem for once and for all. When deciding how much to commit, consider your regularly hourly rate, then estimate how many hours you’ve spent trying to get over this hurdle. In other words, I’m guessing that having this fixed is probably worth more to you than $5… but whatever you can contribute is appreciated.

I’ll manage the collection and pledge to turn the whole sum over to the first developer who can package up a py25-mysql database connector that “just works” with Sun’s stock MySQL for OS X and Apple’s python 2.5. Users should not need to download 1GB of XCode  just to get a compiler or jump through any other hoops. Just a simple installer (CLI OK, but .pkg preferred).

Solution:

OK, so I finally did solve this one. I’ve actually been trying to configure two machines at once, and running into different problem sets — the usual recipes (this is my favorite, but do step #6 before step #0) did work for one machine, but not for the other. One one machine, I thought it wasn’t working because of error messages returned when trying to import MySQLdb from a Python shell. Turns out you can ignore some of these errors and things will still work from within a Python app.

On the other machine, the problem went deeper. I got errors when trying to import MySQLdb, but they were different :

Error loading MySQLdb module: dynamic module does not define init function (init_mysql)

I’m not sure what was different about the two machines, but it was a showstopper. Here’s how I finally solved it.

First of all, don’t use any of the instruction sets you’ll find online for building/installing the mysql-python binding. If you’re getting the “does not define init function” error, the usual recipes won’t work for you (no, I don’t know why – they just won’t).

1) Download, install, and configure the MySQL server dmg from Sun, along with the StartupItem and PreferencePane. Get MySQL itself up and running, with root permission established, etc.

2) Install MacPorts, then use it to retrieve the whole python-mysql package:

/opt/local/bin/port install py25-mysql

This will take a while – it unfortunately is going to compile/install a complete mysql server, along with the bindings you need. However, it won’t set it to launch on boot or anything, so it won’t mess with anything on your system.

3) All we need are the properly compiled bindings from the py25-mysql package, which we’ll copy to the system’s site-packages dir. So:

1
2
3
4
5
$ cd /opt/local/lib/python2.5/site-packages
# Copy two dirs and three files to system's site-packages dir
sudo cp -r MySQL_python-1.2.2-py2.5.egg-info /Library/Python/2.5/site-packages
sudo cp -r MySQLdb /Library/Python/2.5/site-packages
sudo cp -r _mysql* /Library/Python/2.5/site-packages

4) You can now start a Python shell and enter import MySQLdb with no errors. Yay! But… you still won’t be able to connect to your server from a configured Django project — it’ll complain about not being to find a mysql socket file at /opt/local/var/run/mysql5/mysqld.sock. Not sure what causes that, but it’s easy to fix. In the settings.py for your Django project, specify a path to the socket file as the DATABASE_HOST:

1
DATABASE_HOST = '/tmp/mysql.sock'

You’re in business.

———–

SNOW LEOPARD UPGRADE NOTES

Good news: Snow Leopard upgrades Python to 2.6.1. Bad news: It’ll break your MySQL installation as well as your Python-MySQL database connector. Fortunately, getting things working is a bit easier than it was under Leopard, and you won’t need to rely on MacPorts at all..

I had an older 32 bit version of MySQL installed. With a bit of futzing I was able to get my old MySQL installation running again, but could not get the python-mysql binding working. Finally installed the latest 64-bit version from mysql.com. Before installing, be sure to export the databases you want to keep first! My databases were blown away by the upgrade, and I had to restore them. Get your databases reinstalled, privileges established, and make sure you can connect to your mysql server normally.

To reinstall the Python MySQL connector you’ll need the gcc compiler, which you’ll also find has been blown away in the Snow Leopard upgrade. To get gcc reinstalled, run the Xcode installer from the Snow Leopard DVD.

Now grab the latest version of the python-mysql connector (check to make sure that’s the most current download URL when you read this).

Unpack the archive and cd into its directory. Here’s the key: You’ll need to specify your 64-bit architecture during the compile process:

1
2
ARCHFLAGS='-arch x86_64' python setup.py build
ARCHFLAGS='-arch x86_64' python setup.py install

You should now be able to launch a Python shell and type:

1
>>> import MySQLdb

and get no errors. And your Django projects should work just fine.

Good hunting.

More info

61 Responses to “Python-MySQL Connections on Mac OS”

  1. Jacob says:

    Thank you very much you saved me ungodly amounts of heartache

  2. Lyle says:

    Wow, thanks a million! Or at least 997,412. I had no trouble installing this years ago, but, alas, can’t remember how! I sound like a quote from your article.

    Anyway, the reason people work so hard at getting this to work is, of course, how much you can do once you get it working! I’ve got dozens of little python scripts that whale on my mySQL databases and do marvelous things.

    Thanks again!

  3. Thank you thank you thank you so much!!! All the other recipes out there weren’t working for me, this was perfect.

  4. Doug says:

    I love you.

  5. shacker says:

    I love you too, Doug!

  6. Gareth says:

    I’ve installed Mysql through mac ports – and it works fine.
    Will i need to uninstall this? I really want to get Django and Mysql working…

  7. shacker says:

    Gareth – If you can start a python shell and type “import MySQLdb” with no errors, and your database is working fine, then no reason to go back. These instructions are really for people who have already set up the official mysql and don’t want to have to switch to the macports one just to get the connector working.

  8. Gareth says:

    Thanks, works pefecto! :)

  9. Lennart says:

    Thanks! Kept me busy for three hours but this worked !

  10. zynth says:

    Thanks so much…process was very smooth. This was a real timesaver for me….no more headbanging.

  11. Gregory says:

    This post may have just saved my life. Or at least my career. Definitely my sanity.

    I spent two days trying to get Python/Django/MySQL to work on my Mac the first time around — and then spent two long nights trying to put it all back together again after an ill-fated attempt to install PostgresSQL broke everything. (If you could ever write a SQL sequel on how to get psycopg to work on a Mac, I guarantee it would be an even bigger hit.)

    Anyway, on behalf of data journalism, struggling writers-turned-programmers and Mac lovers everywhere, thankyouthankyouthankyou.

  12. shacker says:

    I don’t do postgres, but glad you found this useful. Judging by the comments, I can see that I’m not alone in my feelings about this screwed up situation. Just amazing that the problem has lasted this long.

  13. Peter Vince says:

    Thank you so much. Finally can import MySQLdb.
    But, I cannot get a connection:
    _mysql_exceptions.OperationalError: (2002, “Can’t connect to local MySQL server through socket ‘/opt/local/var/run/mysql5/mysqld.sock’ (2)”)

    Any suggestions?

  14. shacker says:

    Peter, did you see the end of the tip in the original post?

  15. Peter Vince says:

    Again, thanks so much for the post – but I have no immediate interest in “Django” so using the “settings.py” to set the socket is irrelevant as is setting DATABASE_HOST.
    Furthermore I cannot simply copy /tmp/mysql.sock to /opt/local/var/run/mysql5/mysqld.sock (I get “Operation not supported on socket”).
    Any ideas?

  16. shacker says:

    Peter – I’m not saying you need to be using Django, I’m saying that whatever app or util you’re using to connect to mysql must have a DATABASE_HOST or HOST setting somewhere…

  17. Peter Vince says:

    After looking at _mysql.c, I used the following with success:

    conn=MySQLdb.connect(host=’localhost’, user=’whatever’,
    passwd=’whatever’, unix_socket=’/tmp/mysql.sock’)

    So, thanks much again.

  18. Chris says:

    You are an absolute lifesaver. I spent several hours doing everything I thought I could do… and finally your solution worked.

    THANK YOU.

  19. Kailash says:

    This is so cool. Thanks so much for writing this. I am *so* bookmarking this.

  20. Jerry says:

    I was getting that same init_mysql error. I finally realized I had installed the 64-bit version of MySQL. Once I had the 32-bit version of MySQL installed, I ran python setup.py clean –all to clean my last build then I reran all the MySQL_python install commands. Everything worked fine after that.

    I’m new to Python so I’m uncertain if it is 64-bit ready.

    You can check your installation running these two commands in Terminal:
    cd /usr/local/mysql/lib
    file *

    If you see any libraries listed as “Mach-O 64-bit dynamically linked shared library x86_64″ then you have the 64 bit version.

  21. shacker says:

    Great tips Jerry – thanks. Not sure if that was my issue though – I don’t show any trace of 64-bit libs, but still had the problem.

  22. ygarten says:

    Than you sooo much! great tip, reported back to this site about your solution:
    http://www.mangoorange.com/2008/08/01/installing-python-mysqldb-122-on-mac-os-x/

  23. Guy says:

    You’re the Master!
    It seams impossible to do it without your explanation.
    Thanks

  24. Scot,
    I’m running 10.6, and I’m downloading the MySQL package to install it now.

    I was able to use the easy_install . command, as my MacPorts MySQL binaries were on my ZSH path (if they’re on your BASH path, it should work too) — which was at /opt/local/lib/mysql5/bin.

    I’ll comment back once I test the MySQL installer (I’m on 10.6 but I’m downloading the 10.5 installer; they don’t seem to have a package for 10.6 yet).

  25. On 10.6, I’ve got /usr/local/mysql/bin on my PATH, and I was able to run the easy_install . command, as it could find mysql_config without a problem.

    It’s wrapped itself up in a nice little egg in my Python site-packages directory.
    Processing .
    Running setup.py -q bdist_egg --dist-dir /Users/ben/Downloads/MySQL-python-1.2.3c1/egg-dist-tmp-_9FIBu
    zip_safe flag not set; analyzing archive contents...
    Adding MySQL-python 1.2.3c1 to easy-install.pth file

    Installed /Library/Python/2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg
    Processing dependencies for MySQL-python==1.2.3c1
    Finished processing dependencies for MySQL-python==1.2.3c1

    After that, I pulled up one of my Django projects that uses MySQL, and synced it. Works like a charm.

  26. shacker says:

    Benjamin that’s *great* news – thanks for that news. Makes me feel less squeamish about upgrading.

  27. Here’s another solution from the SourceForge page for the project:

    export ARCHFLAGS=’-arch i386 -arch x86_64′
    cd MySQL-python-1.2.3c1
    python setup.py build
    sudo python setup.py install

    Seems to work fine.

  28. duh says:

    Whoa.

    Thanks for the information. However, I get now the following error when trying to import MySQLdb:

    Python 2.5.4 (r254:67917, Dec 23 2008, 14:57:27)
    [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
    Type “help”, “copyright”, “credits” or “license” for more information.
    >>> import MySQLdb
    Traceback (most recent call last):
    File “”, line 1, in
    File “/opt/local/lib/python2.5/site-packages/MySQLdb/__init__.py”, line 19, in
    import _mysql
    ImportError: dlopen(./_mysql.so, 2): no suitable image found. Did find:
    ./_mysql.so: mach-o, but wrong architecture
    >>>

    Any ideas?

  29. duh says:

    Yeah, I investigated this issue a bit further and concluded that the _mysql.so library does get compiled as “Mach-O 64-bit bundle x86_64″ and my Python is 32-bit = problem.

    Is there some way to force that i386 architecture would be used instead? I found out that MacPorts has a configuration file in /opt/local/etc/macports/macports.conf that has a switch for determining the build architecture. It defaults to x86_64 in Snow Leopard but I forced it to i386. However, it didn’t affect at all, that library still appears to be 64-bit :(

    I wonder if I am the only one here with Snow Leopard having the problem, is everybody else using 64-bit python?

  30. shacker says:

    duh – I haven’t tried this on Snow Leopard yet but my understanding is that SL comes with Python 2.6. Your trace above shows Python 2.5.4, indicating that you’re using using a different (MacPorts?) version of Python.

    I’ll update these notes when I get SL, but if my reading is correct, the binding source compiles pretty clean. For now I recommend you search for sites that document the process for Snow Leopard.

  31. Greek_kid says:

    Thank you master!

  32. shacker says:

    See Snow Leopard update notes above.

  33. I followed the instructions to the letter…I even had to muck about with the stdarg.h file per this link:

    http://packetcloud.net/tag/mysql/

    and I finally (FINALLY!) got build and install to get all the way through, only to hit the following break:

    brandon-watsons-macbook-pro:MySQL-python-1.2.3c1 blwatson$ python
    Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39)
    [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
    Type “help”, “copyright”, “credits” or “license” for more information.
    >>> import MySQLdb
    /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.3-fat64.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.3-fat64.egg/_mysql.pyc, but /Users/blwatson/Downloads/MySQL-python-1.2.3c1 is being added to sys.path
    Traceback (most recent call last):
    File “”, line 1, in
    File “MySQLdb/__init__.py”, line 19, in
    import _mysql
    File “build/bdist.macosx-10.3-fat64/egg/_mysql.py”, line 7, in
    File “build/bdist.macosx-10.3-fat64/egg/_mysql.py”, line 6, in __bootstrap__
    ImportError: dlopen(/Users/blwatson/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.3-fat64.egg-tmp/_mysql.so, 2): no suitable image found. Did find:
    /Users/blwatson/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.3-fat64.egg-tmp/_mysql.so: mach-o, but wrong architecture

    So I am at a loss…I have been wrestling with getting MySQL and Django working for days now. Your info has been immensely helpful in getting me to this stage, so thank you VERY much. However, I am at a roadblock…hopefully you know how to parse the above error.

  34. Ugh, I tried reinstalling and am getting the dreaded mysql.sock error.

    I have installed the 64bit version of MySQL onto Snow Leopard. I went to:

    http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg

    and got:

    Mac OS X 10.5 (x86_64)

    and ran:

    mysql-5.1.39-osx10.5-x86_64.pkg

    once it was installed. I then ran:

    $ sudo ./MySQLCOM start
    Starting MySQL database server

    but then get:

    $ mysql
    ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2)

    the mysql dir in /var is empty. I have also looked in /tmp. Nothing. I then ran:

    $sudo find / -name mysql.sock

    and nothing was found on the disk.

    Lastly, I tried:

    $ sudo mysqld_safe
    Password:
    091001 01:18:42 mysqld_safe Logging to ‘/usr/local/mysql/data/brandon-watsons-macbook-pro.local.err’.
    091001 01:18:42 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
    091001 01:18:44 mysqld_safe mysqld from pid file /usr/local/mysql/data/brandon-watsons-macbook-pro.local.pid ended

    What do I do now?

  35. shacker says:

    Brandon, sorry to have not gotten back to you sooner. Life just got flooded. Did you get this solved? One thing I notice above is that you mention:

    mysql-5.1.39-osx10.5

    but you’re talking about installing on Snow Leopard.

  36. Mariano says:

    You rock man! Thanks so much!
    I’ve been trying many times to get it working and you just explained it great.

    Thanks!
    Mariano.

  37. Thanks, you just saved my butt. I thought this was one of those issues I’d spend hours on.

  38. cinaglia says:

    Thanks. This really helped me out. I had spent two hours, and I supposed that if I hadn’t stumbled upon this, it would keep giving some trouble for awhile.

  39. Cyrus says:

    thanks++. This was really helpful.

  40. Lucas says:

    I solved the problem “Error loading MySQLdb module: dynamic module does not define init function (init_mysql)” as follows:

    - I listed all the contents from py26-mysql doing the following

    # port contents py26-mysql

    - and I added the following entry to /etc/profile

    export PYTHONPATH=”/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/”

    Good post!. I think you can add this as an alternative way :).

    L.

  41. brianz says:

    I spent the good part of a day battling this as well. Everytime I get a new Mac, I seem to stumble through this.

    I was getting the “wrong architecture” error from the _mysql.so which was being built, even thought I was passing the 64-bit build args. I ended up switching to 32-bit MySql, and built MySQLdb with “-arch i386″. Voila…everything works….finally.

    I think the reason why this has been so painful for so long is that the author considers OS X a “fringe operating system“. :>)

  42. shacker says:

    Heh – Well, he apparently considers Windows a “fringe operating system” too :)

  43. znice says:

    Hey, thanks! I spent about an hour and a half beating my head against the wall trying to wrangle the release version up on sourceforge into working. Almost just went with another database I was so frustrated. Props and gratitude!

  44. Fabian says:
    DATABASE_HOST = ‘/tmp/mysql.sock’

    Thanks so much for this. After much frustration, this was able to get everything working.

  45. [...] MySQL-python have broken the recipe below: some stuff is still valid, but you’d better check this blog post for more [...]

  46. Cheeky says:

    For heaven’s sake man, put the tip jar back out!

  47. pjm says:

    Incredible that this is still such a clusterf**k after so long. Do most python/django developers use Postgres, or something?

  48. shacker says:

    pjm, I agree that it’s incredible. But nope, most python/django devs do use MySQL. We just wrestle through this and then hope the next OS update doesn’t break everything. File under “puts hairs on your chest.”

  49. Kieran says:

    What can I say, except I was in a world of pain there for many evenings going round in circles, uninstalling, reinstalling completely removing mysql and the python mysql a number of times until I found this.
    Thank you!!! This worked I just launched django successfully connected to mysql rather than mysqlite for the first time, wow thank you again!

  50. magicrebirth says:

    thanks man you don’t know how many hours i spent on this :)

  51. Daniel says:

    Hi,

    I have tried all possible solutions but this is still not working for me and I have no idea why. The last solution I tried was the SNOW LEOPARD one. I did all the steps. Erased my previous mysql (MAMP), reinstall the 64-bit architecture mysql (working fine now!) and run the xcode installer.

    Then I did the steps you suggest but when I do: ARCHFLAGS=’-arch x86_64′ python setup.py build I get a huge list of errors:
    running build
    running build_py
    copying MySQLdb/release.py -> build/lib.macosx-10.5-fat64-2.6/MySQLdb
    running build_ext
    building ‘_mysql’ extension
    gcc -L/sw/lib -bundle -L/sw/lib/python2.6/config -lpython2.6 -arch x86_64 build/temp.macosx-10.5-fat64-2.6/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -lmygcc -o build/lib.macosx-10.5-fat64-2.6/_mysql.so
    ld: warning: in /sw/lib/python2.6/config/libpython2.6.dylib, file is not of required architecture
    Undefined symbols:
    “_PyMember_SetOne”, referenced from:

    …. (a lot more stuff here)…
    and at the end
    __mysql_server_init in _mysql.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    error: command ‘gcc’ failed with exit status 1

    Please I have spent two days trying to solve this issue and no luck so far… any help will be strongly appreciated :-)

  52. shacker says:

    Daniel – Are you actually ON Snow Leopard, or did you try that technique on Leopard?

  53. Daniel says:

    No, i am ON snow leopard… mac os X version 10.6.2 build 10C540 and when i run python i get Python 2.6.2 (r262:71600, Apr 28 2009, 20:43:17)
    [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
    and gcc –version
    i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1)
    Copyright (C) 2007 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    not sure if that helps you but at this point I am quite hopeless :-(… thanks a lot shacker

  54. shacker says:

    Hmm… I wonder how you ended up with version 2.6.2 of Python. I’m on SL and have 2.6.1. I’d hate to think such a minor version difference would prevent compilation, but maybe there’s something non-standard in your Python install?

  55. Daniel says:

    hmmmm not sure either… do you know a good way to uninstall python and install the version you have? where can I download the python version you are suggesting? i could try that and see if it works, at this point i’m clueless of what’s going on so may be worth trying…

  56. shacker says:

    If you type:

    $ which python

    what do you get? I get:

    /usr/bin/python

    And if you run:

    /usr/bin/python

    does it then show 2.6.1?

  57. Daniel says:

    mmm if i type which python i get:
    /sw/bin/python
    and there is nothing in the folder usr/bin/python

  58. Daniel says:

    oooops sorry yes, you are right

  59. Daniel says:

    if i run usr/bin/python I run Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)

  60. shacker says:

    OK I think that’s your problem. You’ve installed a non-apple copy of python in /sw/bin – maybe from fink or ports? You should be able to find a line in your ~/.profile or or ~/.bash_profile that’s setting a shell path that finds that version before it finds the native version. Comment out that line, restart terminal, and try “which python” again. When it returns the correct path, go back and try compiling the driver from source again (you might have to “make clean” or just start with a fresh tarball).

  61. Daniel says:

    wow! no comments!!!!! you are a life savior! :-) thanks you sooooooooo much…

Leave a reply

→ Want an avatar/icon to show up alongside your comment? Get a free Gravatar. ←