To install python and plone on Centos 5.1 VPS

I want to install python 2.5.2 to run turbogears and bind to mysql and at the same time install plone in /opt using unified plone installer. The plone uses python 2.4.4 and is it possible to bind python 2.4.4 to mysql too.

To install python 2.5.2, what other dependencies do I need to download to install and bind to mysql
Roslan RamliAdvisorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
agriesserCommented:
Python 2.4.4 should work with MySQL databases. Have you tried it already?

Using the unified installer should work around these problems too, as it installs python in a separate directory (if not already available) and is not bound to a specific version of python.

I'd say: Just give it a try and see how it fairs. In case of any troubles that may arise, post them here and we'll get that sorted.
0
 
Roslan RamliAdvisorAuthor Commented:
First step is I installed python 2.5.2
typing python on terminal still shows python 2.4.3  - which is the default installed python
How do I make python to run on python 2.5.2?
0
 
Roslan RamliAdvisorAuthor Commented:
ok, I've got python 2.5.2 needs a reboot.

I will install turbogears using tgsetup
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
Roslan RamliAdvisorAuthor Commented:
turbogears installed
mysql-python binding installed - using easy_install
plone is up

cannot access webmin - maybe its the firewall? I did an update on system

cannot access plone too
0
 
Roslan RamliAdvisorAuthor Commented:
The last part to bind mysql to python from plone :

I cd /opt/Plone3.1/Python-2.4/bin
and ./easy_install-2.4 MySQL-python. It went ok

What is the best way to confirm that python 2.5.2 and python 2.4.5 binds to MySQL

I'll address the plone and webmin in another question. Perhaps its the firewall cause I did a yum update since this is a fresh install of centos
0
 
agriesserCommented:
Well you could write a little python test script like the one below.
Save it as "test.py" and start it using `python test.py`:

tuxx@vi-edv003:~$ python test.py
server version: 5.0.51a-6
tuxx@vi-edv003:~$

It should display the MySQL server version and therefore you know, that it's working with MySQL.

Please note that you need to change the values for user, passwd and db in the example shown below to match your database.
import MySQLdb
 
conn = MySQLdb.connect(host = "localhost",
                           user = "testuser",
                           passwd = "testpass",
                           db = "testdb")
cursor = conn.cursor ()
cursor.execute ("SELECT VERSION()")
row = cursor.fetchone ()
print "server version:", row[0]
cursor.close ()
conn.close ()

Open in new window

0
 
Roslan RamliAdvisorAuthor Commented:
The system python is now 2.5.2
Plone is running on python 2.4.5 -  Zope Version    (Zope 2.10.6-final, python 2.4.5, linux2)

But
[root@dev bin]# python2.4
Python 2.4.3 (#1, May 24 2008, 13:47:28)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

[root@dev bin]# python
Python 2.5.2 (r252:60911, Jun 25 2008, 05:35:40)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

[root@dev home]# python test.py
server version: 5.0.45
[root@dev home]#

[root@dev home]# python2.4 test.py
Traceback (most recent call last):
  File "test.py", line 1, in ?
    import MySQLdb
ImportError: No module named MySQLdb

The thing is how do I bind python 2.4.5 in /opt/Plone3.1/Python2.4/ to mysql
0
 
agriesserCommented:
Well, then you need to install the MySQL binding for python 2.4.5.

On my system, all python versions are bound to MySQL correctly as you can see here:

tuxx@vi-edv003:~$ python2.5 test.py
server version: 5.0.51a-6
tuxx@vi-edv003:~$ python2.4 test.py
server version: 5.0.51a-6
tuxx@vi-edv003:~$ python2.5
Python 2.5.2 (r252:60911, May 28 2008, 08:35:32)
[GCC 4.2.4 (Debian 4.2.4-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
tuxx@vi-edv003:~$ python2.4
Python 2.4.5 (#2, Apr 17 2008, 13:00:52)
[GCC 4.2.3 (Debian 4.2.3-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
tuxx@vi-edv003:~$

I checked the CentOS download mirrors and found a package called MySQL-python-1.2.1.rpm which contains the mysql extension for the installed python2.4 package. You can download it from here:

http://mirror.centos.org/centos/5/os/i386/CentOS/MySQL-python-1.2.1-1.i386.rpm

Install it using `rpm -Uhv MySQL-python-1.2.1-1.i386.rpm` and check that there are now files in the following directories:

./usr/lib/python2.4/
./usr/lib/python2.4/site-packages/
./usr/lib/python2.4/site-packages/_mysql_exceptions.pyo
./usr/lib/python2.4/site-packages/_mysql.so
./usr/lib/python2.4/site-packages/_mysql_exceptions.pyc
./usr/lib/python2.4/site-packages/_mysql_exceptions.py
./usr/lib/python2.4/site-packages/MySQLdb/
./usr/lib/python2.4/site-packages/MySQLdb/connections.pyo
./usr/lib/python2.4/site-packages/MySQLdb/converters.pyc
./usr/lib/python2.4/site-packages/MySQLdb/__init__.py
[...]
0
 
Roslan RamliAdvisorAuthor Commented:
[root@dev ~]# rpm -Uhv MySQL-python-1.2.1-1.i386.rpm
error: Failed dependencies:
      mx is needed by MySQL-python-1.2.1-1.i386
[root@dev ~]#

How can I install mx
0
 
agriesserCommented:
Get it here:

http://mirror.centos.org/centos/5/os/i386/CentOS/mx-2.0.6-2.2.2.i386.rpm

Install it the same way (rpm -Uhv mx-2.0.6-2.2.2.i386.rpm).

0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
Roslan RamliAdvisorAuthor Commented:
[root@dev home]# python2.4 test.py
server version: 5.0.45
[root@dev home]# python2.5 test.py
server version: 5.0.45
[root@dev home]#

Looks ok
One question:
Is Python 2.4.5 from Plone using Python 2.4.3 to bind to MySQL?
0
 
Roslan RamliAdvisorAuthor Commented:
Thank You
0
 
agriesserCommented:
Great.

Good question. I don't think that it makes a big difference, because inside the 2.4 branch of python, the plugins should be compatible and therefore both versions should be fixed by installing this package (please note that I don't know exactly how your python versions are installed, but usually, you should be safe now).
0
 
Roslan RamliAdvisorAuthor Commented:
python 2.4.3 comes with the centos VPS.
python 2.5.2 was dowwnloaded from python.org.. ./configure, make, make install
and plone ./install.sh standalone

Should that be all alright?
0
 
agriesserCommented:
Sounds good, but I don't know the configuration details of the selfcompiled versions, but they seem to at least share the python site-configuration directory, which is basically a good sign for a working setup.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.