Menu

installing MySQLdb OS X 10.4.8 w/Python 2.5

Help
Ryan
2007-03-09
2012-09-19
  • Ryan

    Ryan - 2007-03-09

    So I've been reading up on other threads but can't find anything specifically related to this, so I figured I would post something. I am attempting to build and install MySQLdb 1.2.2 on OS X 10.4.8 using Python 2.5 and MySQL 5.0.

    Currently when I try to build MySQLdb I get the following message:

    python setup.py build
    running build
    ...
    creating build/temp.macosx-10.3-fat-2.5
    gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.3-fat-2.5/_mysql.o -Os -arch ppc -fno-common
    unable to execute gcc: No such file or directory
    error: command 'gcc' failed with exit status 1

    Now from what I understand this has something to do with gcc verisons being out of whack, but i'm not sure how to go about fixing it (I'm a bit of a newb when it comes to playing around in unix internals). I have already edited the site.cfg file to reflect where mysql_config is located.

    Thanks to anyone that can help out.

     
    • Skip Montanaro

      Skip Montanaro - 2007-03-18

      Sorry for the delay. What version of gcc are you running? You should, I think, be running gcc 4.0.1. Try:

      gcc --version
      

      If that's not the case you can run

      sudo gcc_select 4.0
      

      to make it so.

      Second thing... From /usr/include, do you have all these versions of limit.h?

      %% cd /usr/include
      %% find . -name 'limits.h'
      ./gcc/darwin/3.3/machine/limits.h
      ./i386/limits.h
      ./limits.h
      ./machine/limits.h
      ./ppc/limits.h

      Skip

       
      • jk_in1

        jk_in1 - 2007-05-09

        I am trying to Install Python 2.5 with MySql as the backend but i am unable to locate the documentation file (mysql.txt)under DOC folder, can someone please direct me where to find it or attach the mysql.txt file.
        Thanks

         
        • Andy Dustman

          Andy Dustman - 2007-05-09

          I have no idea what this means... Could you explain what you did and what happened (or failed to happen)?

           
          • jk_in1

            jk_in1 - 2007-05-14

            I downloaded MySQL-python-1.2.2.win32-py2.5 and python2.5 from "http://roundup.sourceforge.net/doc-0.8/installation.html" and I am trying to use mysql as the backend for roundup issue tracker, In the Installation steps it says "You must read doc/mysql.txt for additional installation steps and requirements" but I am unable to locate this file. I was hoping if someone can help get these installation steps
            Thanks and appreciate your help.

             
      • Ryan

        Ryan - 2007-03-19

        No worries about the delay, I appreciate the help regardless.

        Currently I'm running gcc 4.0.0.

        Secondly, yes,

        ./gcc/darwin/3.3/machine/limits.h
        ./i386/limits.h
        ./limits.h
        ./machine/limits.h
        ./ppc/limits.h

        are all there on my system.

         
        • Skip Montanaro

          Skip Montanaro - 2007-03-19

          Find out how to get gcc 4.0.1 or later onto your system, perhaps by upgrading XCode. I seem to recall some problems when gcc 4.0 first came out.

          Skip

           
          • Ryan

            Ryan - 2007-03-20

            Thanks! I downloaded the newest version of XCode (1 gig download 0.o), and installed and the package installed fine.

            Thank you again for your help.

             
            • Victor

              Victor - 2007-06-27

              I'm on 10.4.9 with the latest XCode
              - gcc 4.0.1
              - MySQL 5.0.41
              - Python 2.5.1

              I checked and I do have all the limits.h files listed.

              and trying to install MySQLdb 1.2.2 but I'm getting the following error:

              python setup.py build

              /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c6-py2.5.egg/setuptools/command/sdist.py:3: UserWarning: Module ez_setup was already imported from /Users/victor/tmp/MySQL-python-1.2.2/ez_setup.pyc, but /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/QuickWiki-0.1.4-py2.5.egg is being added to sys.path
              import os, re, sys, pkg_resources
              running build
              running build_py
              copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb
              running build_ext
              building '_mysql' extension
              gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/_mysql.o -L/usr/local/mysql/lib -lmysqld -lz -lm -o build/lib.macosx-10.3-fat-2.5/_mysql.so
              /usr/bin/ld: for architecture ppc
              /usr/bin/ld: can't locate file for: -lmysqld
              collect2: ld returned 1 exit status
              /usr/bin/ld: for architecture i386
              /usr/bin/ld: warning build/temp.macosx-10.3-fat-2.5/_mysql.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
              /usr/bin/ld: can't locate file for: -lmysqld
              collect2: ld returned 1 exit status
              lipo: can't open input file: /var/tmp//ccs7f6Oo.out (No such file or directory)
              error: command 'gcc' failed with exit status 1

              Any ideas?
              Thanks!
              Victor

               
    • Skip Montanaro

      Skip Montanaro - 2007-03-09

      Do you have the XCode tools installed? If you execute

      type gcc
      

      at a shell prompt does it print "/usr/bin/gcc"?

      Skip

       
    • Ryan

      Ryan - 2007-03-12

      You were correct, I was lacking xcode. Now when I try to to build i get a nasty error message. I won't copy the entire thing since it looks like a bunch of parse errors and such but this is the gist:

      running build
      running build_py
      copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb
      running build_ext
      building '_mysql' extension
      gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.3-fat-2.5/_mysql.o -Os -arch ppc -fno-common
      In file included from pymemcompat.h:10,
      from _mysql.c:29:
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:18:20: error: limits.h: No such file or directory
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:21:2: error: #error "Something's broken. UCHAR_MAX should be defined in limits.h."
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:25:2: error: #error "Python's source code assumes C's unsigned char is an 8-bit type."
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:32:19: error: stdio.h: No such file or directory

      ...

      a bunch of errors like the following:

      In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:129,
      from pymemcompat.h:10,
      from _mysql.c:29:
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/eval.h:10: error: parse error before '' token
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/eval.h:10: error: parse error before '
      ' token
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/eval.h:10: warning: data definition has no type or storage class
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/eval.h:12: error: parse error before '' token
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/eval.h:12: error: parse error before '
      ' token
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/eval.h:18: warning: data definition has no type or storage class
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/eval.h:20: error: parse error before '' token
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/eval.h:20: error: parse error before '
      ' token
      /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/eval.h:20: warning: data definition has no type or storage class
      In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:131,
      from pymemcompat.h:10,

      then a bunch more like this:

      _mysql.c:2770: warning: (near initialization for '_mysql_methods[10]')
      _mysql.c:2772: warning: excess elements in struct initializer
      _mysql.c:2772: warning: (near initialization for '_mysql_methods[10]')
      _mysql.c:2773: warning: excess elements in struct initializer
      _mysql.c:2773: warning: (near initialization for '_mysql_methods[11]')
      _mysql.c:2773: warning: excess elements in struct initializer
      _mysql.c:2773: warning: (near initialization for '_mysql_methods[11]')
      _mysql.c:2776: error: parse error before '' token
      _mysql.c:2778: error: parse error before '
      ' token

      it eventually ends with this:

      _mysql.c:2840: error: request for member 'ob_refcnt' in something not a structure or union
      _mysql.c:2877: error: parse error before ')' token
      _mysql.c:2877: error: parse error before ')' token
      _mysql.c:2877: error: parse error before ')' token
      error: command 'gcc' failed with exit status 1

       
      • Skip Montanaro

        Skip Montanaro - 2007-03-12

        Let's start with the first error and ignore the other stuff. In my experience with gcc it's useless to consider anything else since the missing file contents are crucial to later parts of the parse.

        In file included from pymemcompat.h:10,
        from _mysql.c:29: 
        /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:18:20: error: limits.h: No such file or directory
        

        Do you have /usr/include/limits.h, /usr/include/machine/limits.h and both /usr/include/ppc/limits.h and /usr/include/i386/limits.h? I don't think I've ever built a fat binary before. Still, they are all there in my PowerBook. It appears you are missing /usr/include/limits.h (at least).

        Skip

         
    • Ryan

      Ryan - 2007-03-12

      When browsing /usr/include and /usr/include/machine in terminal I do see a file named limits.h

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.