[TxMt] Re: SQL Problems

Matthew Anderson manders2k.lists at gmail.com
Wed Oct 18 23:42:45 UTC 2006


If you've installed the MySQLdb package from the pythonmac.org  
website, it should be installed under python2.4.

To make sure you're using the python 2.4 binary, change the #! line to:

   #!/usr/local/bin/python2.4

If you've also installed python2.5, and haven't successfully  
installed MySQLdb under python2.5, your script might be using that  
instead.  I don't know that copying the module from 2.4's site- 
packages into 2.5's site-packages will actually work.  I kind of  
doubt it.

Also, if you're knowledgeable about python programming, actually use  
MySQLdb under whichever version it's supposed to be functioning (say,  
2.4) to view the database.  Make sure it's working by hand.  That  
might be a little difficult to do, depending on your level of  
experience.

As far as setting the default version goes:

If you execute "echo $PATH" on the command line, does "/usr/local/ 
bin" appear in the list?  Does it appear before "/usr/bin"?

To select which python is the default, assuming /usr/local/bin is the  
first directory in your path to contain a listing for "python",  
you've got to symlink /usr/local/bin/python to whichever version of  
python you want to be the default version.  For example:

   > cd /usr/local/bin
   > sudo rm python
   > sudo ln -s python2.4 python


On Oct 18, 2006, at 6:08 PM, Jasper van der Meulen wrote:

> Thanks,
> but that didn't workout :(
> I've Installed now:
> 2.4.3 (didnt work)
> 2.5 (didn work)
> An installation of MySQLdb (the package from http://pythonmac.org/ 
> packages/py24-fat/index.html ) (didnt work on orignal python,  
> 2.4.3, 2,5)
>
> did a search on MySQLdb on my drive in the /usr dir ..
> found it :-)
> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ 
> site-packages
> there..and copied it into
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ 
> site-packages
> But it all didn't work out ..
> >> import MySQLdb
> MySQLdb/__init__.py:19: RuntimeWarning: Python C API version  
> mismatch for module _mysql: This Python has API version 1013,  
> module _mysql has version 1012.
>
> Then i've installed gcc 4.0 from the developer package (XCode)
> Then i've downloaded the package from http://sourceforge.net/ 
> projects/mysql-python and tried to compile
> /usr/bin/env gcc gives i686-apple-darwin8-gcc-4.0.1
> Tried to compile ... didn't work out .. lot's of errors ..
>
> Any tricks left ?
>
> Regards J.
>
>
> On 18-okt-2006, at 23:57, Jacob Rus wrote:
>
>>
>> At this point I don't think there's any reason *not*
>> to just install [Python 2.5][py25] from python.org,
>> and then do the `sudo python setup.py install` routine.
>> There are some nifty new things in python 2.5, and as
>> far as I know, no issues running code for 2.3 or 2.4.
>>
>> [py25]: http://www.python.org/download/releases/2.5/
>>
>> -Jacob
>>
>>
>> _____________________________________________________________________ 
>> _
>> For new threads USE THIS: textmate at lists.macromates.com
>> (threading gets destroyed and the universe will collapse if you  
>> don't)
>> http://lists.macromates.com/mailman/listinfo/textmate
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate

--
  Matt Anderson





More information about the textmate mailing list