Results 1 to 4 of 4

Thread: Issues installing mysqldb-python

  1. #1
    Banned
    Join Date
    Jun 2012
    Gender
    Location
    90 90
    Age
    31
    Posts
    1,714
    Thanks
    876
    Thanked 2,877 Times in 1,139 Posts


    Downloads
    44
    Uploads
    1
    Mentioned
    562 Post(s)
    Time Online
    118 d 6 h 45 m
    Avg. Time Online
    1 h 30 m
    Rep Power
    0
    Gamer IDs

    Gamertag: DarkByt3 PSN ID: raredaredevil

    Issues installing mysqldb-python

    I am trying to install mysqldb-python onto a centos vps server via ssh terminal. Heres what im doing:


    easy_install mysql-python

    Now when i run python from terminal:
    Last login: Thu Dec 6 14:23:54 2012 from -----------
    [root@fkn ~]# python2.7
    Python 2.7.2 (default, Oct 30 2012, 15:05:12)
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import MySQLdb
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: No module named MySQLdb
    >>>


    What I think the problem may be:

    When I run "python scriptname.py" python 2.4 loads by default , So I use "python2.7 scriptname.py" the package manager in plesk does not allow me to uninstall the default python as Centos uses it.


    So I tried the above test with just the standard python installation:

    [root@fkn ~]# python
    Python 2.4.3 (#1, Jun 18 2012, 08:55:23)
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import MySQLdb
    >>>


    This works! So my easyinstall is installing the script for the wrong python is there any easy solution to this?

  2. #2
    Little Brother


    Zachafer's Avatar
    Join Date
    Dec 2011
    Gender
    Posts
    1,206
    Thanks
    723
    Thanked 1,392 Times in 651 Posts


    Downloads
    81
    Uploads
    17
    Mentioned
    497 Post(s)
    Time Online
    21 d 17 h 32 m
    Avg. Time Online
    16 m
    Rep Power
    14
    Make sure you have python-dev installed.

    This should work otherwise: http://ubuntuforums.org/showpost.php...1&postcount=19

  3. The Following User Says Thank You to Zachafer For This Useful Post:

    DarkByte (12-07-2012)

  4. #3
    Banned
    Join Date
    Jun 2012
    Gender
    Location
    90 90
    Age
    31
    Posts
    1,714
    Thanks
    876
    Thanked 2,877 Times in 1,139 Posts


    Downloads
    44
    Uploads
    1
    Mentioned
    562 Post(s)
    Time Online
    118 d 6 h 45 m
    Avg. Time Online
    1 h 30 m
    Rep Power
    0
    Gamer IDs

    Gamertag: DarkByt3 PSN ID: raredaredevil
    Thanks with a little more digging with the info you posted I got it!


    /root$ sh setuptools-0.6c11-py2.7.egg
    Processing setuptools-0.6c11-py2.7.egg
    Copying setuptools-0.6c11-py2.7.egg to /usr/local/lib/python2.7/site-packages
    Adding setuptools 0.6c11 to easy-install.pth file
    Installing easy_install script to /usr/local/bin
    Installing easy_install-2.7 script to /usr/local/bin

    Installed /usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
    Processing dependencies for setuptools==0.6c11
    Finished processing dependencies for setuptools==0.6c11
    /root$ easy_install mysql-python
    Searching for mysql-python
    Reading http://pypi.python.org/simple/mysql-python/
    Reading http://sourceforge.net/projects/mysql-python/
    Reading http://sourceforge.net/projects/mysql-python
    Best match: MySQL-python 1.2.4c1
    Downloading http://pypi.python.org/packages/sour...-0.6.28.tar.gz
    Downloading http://pypi.python.org/packages/sour...a064db6a889613
    Processing MySQL-python-1.2.4c1.zip
    Running MySQL-python-1.2.4c1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-dxDCyG/MySQL-python-1.2.4c1/egg-dist-tmp-ZGj_rN
    Extracting in /tmp/easy_install-dxDCyG/MySQL-python-1.2.4c1/temp/tmpre4Uzo
    Now working in /tmp/easy_install-dxDCyG/MySQL-python-1.2.4c1/temp/tmpre4Uzo/distribute-0.6.28
    Building a Distribute egg in /tmp/easy_install-dxDCyG/MySQL-python-1.2.4c1
    /tmp/easy_install-dxDCyG/MySQL-python-1.2.4c1/distribute-0.6.28-py2.7.egg
    zip_safe flag not set; analyzing archive contents...
    Adding MySQL-python 1.2.4c1 to easy-install.pth file

    Installed /usr/local/lib/python2.7/site-packages/MySQL_python-1.2.4c1-py2.7-linux-x86_64.egg
    Processing dependencies for mysql-python
    Finished processing dependencies for mysql-python


    I had to update the python .egg fiile used for easy install for a 2.7.egg , done that and.....


    Last edited by DarkByte; 12-07-2012 at 07:12 AM.

  5. #4
    Little Brother


    Zachafer's Avatar
    Join Date
    Dec 2011
    Gender
    Posts
    1,206
    Thanks
    723
    Thanked 1,392 Times in 651 Posts


    Downloads
    81
    Uploads
    17
    Mentioned
    497 Post(s)
    Time Online
    21 d 17 h 32 m
    Avg. Time Online
    16 m
    Rep Power
    14
    Good work!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •