Hostmonster : Installing MySQLdb at a specific location

Tim Johnson tim at johnsons-web.com
Mon Aug 1 19:05:33 EDT 2011


* Tim Johnson <tim at johnsons-web.com> [110731 11:47]:
>  I don't want to discourage any further input, but I'm looking at
>  https://my.hostmonster.com/cgi/help/000531?step=000531
>  regarding installing django and I think the instructions can be
>  extrapolated for MySQLdb. I will report what happens...
  I received a link for the Hostmonster helpdesk to 
    https://my.hostmonster.com/cgi/help/530

 My experience was that I had to modify some of the paths from
 the original.
 When I ran the 
   python setup.py install
 routine, python complained that it could not find `lib64'
 thusly, I created $HOME/.local/lib/python2.4/site-packages
 Furthermore, seems that setup.py did not copy all files
 from the installation directory. The result was a UserWarning
 regarding multiple imports of the _mysql module when I invoked
 import MySQLdb.

 I solved that by adding the installation directory to my 
 PYTHONPATH.
 A relevant excerpt from .bashrc looks like this:
 #BEGIN - 
 # line one
 export
 PYTHONPATH=$HOME/.local/lib64/python/site-packages:$PYTHONPATH
 # line two
 export
 PYTHONPATH=$HOME/.local/lib64/python2.4/site-packages:$PYTHONPATH
 # line three
 export
 PYTHONPATH=$HOME/admin/.install/MySQL-python-1.2.3:$PYTHONPATH
 # line four
 export PATH=$HOME/.local/bin:$PATH
 #END
 Where $HOME/admin/.install/MySQL-python-1.2.3 is the package
 install directory.

 I have been spoiled by ubuntu. Furthemore, it has been a long time
 since I did a package install where I don't have root privileges.

 Results may vary, I hope this is helpful to someone else.

 cheers

-- 
Tim 
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.com



More information about the Python-list mailing list