PDA

View Full Version : Python Modules And easy_install



Skylude
07-03-2009, 03:12 AM
Here is a quick guide to installing easy_install to assist with the installation of Python modules.

The modules that can be installed with this feature are listed here, http://pypi.python.org/simple/

First of all you will need to install the lastest version of Python from the Site Manager as well as the Gnu Compiler Collection or GCC. Once those are installed you will be ready to install Python modules.

From an SSH terminal run the following command,


wget http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c9-py2.5.egg#md5=fe67c3e5a17b12c0e7c541b7ea43a8e6

Once that has downloaded execute the following,


sh setuptools-0.6c9-py2.5.egg

This will install easy_install to the following location, /usr/local/python-2.5/bin/easy_install

You will most likely want to copy the command into your /usr/bin/ folder so you can utilize this command from any directory without having to use the full path. This can be done with the following command,


cp /usr/local/python-2.5/bin/easy_install /usr/sbin/

Now you can use the easy_install command to install a number of different modules. In this example I am using easy_install to install MySQL-python.


easy_install MySQL-python

And it is as easy as that. MySQL-python is now installed and ready to use.

snowers
07-03-2009, 01:17 PM
I'm running into a problem trying to import mysqldb ... its spitting out: ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory

This post (http://www.gossamer-threads.com/lists/zope/db/211113) suggests a solution but I haven't figured out how to make it work yet.

Otherwise, it seems an excellent solution.

snowers
07-03-2009, 08:56 PM
There is a libmysqlclient_r.so.15.0.0 in /usr/local/mysql/lib/mysql/ but I'm unable to create a symbolic link (permission denied) and I get the following error when I try ldconfig (solution from http://markmail.org/message/vjc76ecxtmhwrr6r#query:ldconfig%20libmysqlclient+p age:1+mid:vjc76ecxtmhwrr6r+state:results):
ldconfig: Can't link /usr/local/mysql/lib/mysql/libmysqlclient.so.15 to libmysqlclient.so.15.0.0

Seems there must be a simple solution to this somewhere ....

wildjokerdesign
07-04-2009, 08:19 PM
The post you linked to suggested this;

To permanently add /usr/local/lib/mysql to ld search directory path, add it to /etc/ld.so.conf file (it is just plain text file - add yet another line to the end of the file) and run ldconfig without parameters to rebuild ld.so.cache.

Did you try that or did you try creating a symbolic link. The above should work suggestion should have worked.

snowers
07-05-2009, 02:51 PM
ldconfig doesn't want to link the files.
I downloaded an rpm of mysql and extracted the libmysqlclient_r.so.15, which appears to be a link to libmysqlclient_r.so.15.0.0. With this file in place I produced a new error message: file too short.
Renaming the 15.0.0 file to 15 seems to solve that problem (though it strikes me as a hack) but produces a new error message:
ImportError: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by .../.python-eggs/MySQL_python/.../_mysql.so).

I feel like I've gone down a rabbit hole....

wildjokerdesign
07-06-2009, 09:59 AM
You can't use rpm's on the WestHost system. That could be the root of your problem.

snowers
07-06-2009, 11:44 AM
Hmm. Perhaps I'll undo what I've got and try again.

I was reading up on the migration to 4.0 yesterday ... will all this break in the fall anyway?

wildjokerdesign
07-09-2009, 06:06 PM
I was reading up on the migration to 4.0 yesterday ... will all this break in the fall anyway?

Yep! If you really need this you might want to look at migrating to vps.net. Now it could be that WH 4.0 would have something built into it that would suite your needs but it is a shared hosting environment so modifications like this would not "stick'.