Jump to content

[Solved] python 2.7 on charlie?


zonedabone

Recommended Posts

Would it be possible to have charlie be on the bleeding edge when it comes to pythn? It'd be great if it had python 2.7 with the newest django version. Better yet, move old python users there and then put a new version of python on stevie.

 

Perhaps even just install python 2.7 under usr/bin/python2.7 (apt-get does this for you automatically) the only problem would be configuring wsgi to use either version depending on user request.

Link to comment
Share on other sites

  • Replies 31
  • Created
  • Last Reply

Top Posters In This Topic

Sorry... somebody requested this earlier, so I tried to do it, and it broke yum. Unfortunately, CentOS/RHEL is really picky and needs a ridiculously outdated version of Python.

 

I'd like to see a newer version as well, but I'm not sure we have very many options here.

Link to comment
Share on other sites

Sorry... somebody requested this earlier, so I tried to do it, and it broke yum. Unfortunately, CentOS/RHEL is really picky and needs a ridiculously outdated version of Python.

 

I'd like to see a newer version as well, but I'm not sure we have very many options here.

 

What OS is charlie running? If it's debian based, you could have multiple versions of python. (I have 5 on my ubuntu install) Then you could have all the other programs use /usr/bin/python and have wsgi use /usr/bin/python2.7. Of course, I've never run a web server, so there's probably some silly thing that makes my idea totally ineffective.

Link to comment
Share on other sites

Sorry... somebody requested this earlier, so I tried to do it, and it broke yum. Unfortunately, CentOS/RHEL is really picky and needs a ridiculously outdated version of Python.

 

I'd like to see a newer version as well, but I'm not sure we have very many options here.

 

What OS is charlie running? If it's debian based, you could have multiple versions of python. (I have 5 on my ubuntu install) Then you could have all the other programs use /usr/bin/python and have wsgi use /usr/bin/python2.7. Of course, I've never run a web server, so there's probably some silly thing that makes my idea totally ineffective.

It's running CentOS which uses a RPM based packaging system (Think Redhat/Fedora), not DEB packages (Debian/Ubuntu).

 

@djbob: no chance you could compile from source?

Link to comment
Share on other sites

Sorry... somebody requested this earlier, so I tried to do it, and it broke yum. Unfortunately, CentOS/RHEL is really picky and needs a ridiculously outdated version of Python.

 

I'd like to see a newer version as well, but I'm not sure we have very many options here.

 

What OS is charlie running? If it's debian based, you could have multiple versions of python. (I have 5 on my ubuntu install) Then you could have all the other programs use /usr/bin/python and have wsgi use /usr/bin/python2.7. Of course, I've never run a web server, so there's probably some silly thing that makes my idea totally ineffective.

It's running CentOS which uses a RPM based packaging system (Think Redhat/Fedora), not DEB packages (Debian/Ubuntu).

 

@djbob: no chance you could compile from source?

 

You've got to be kidding. No debian? Is stevie the same thing? Sheesh. Still, it seems like it should be possible to maintain multiple versions of python. Considering that there are very few users on charlie, now would be the best time to try.

Link to comment
Share on other sites

What errors happened when compiling source? Or was it during install? I think that you need to supply an odd arguement to get multiple python versions on a linux distribution.

 

http://pythonicway.blogspot.com/2011/02/in...nux-ubuntu.html

 

This is python 3.2 on ubuntu, but the same process should apply to any linux operating system, because it doesn't rely on the deb package system. specifically it might work to use the alt-install parameter when building the source, as shown here.

Link to comment
Share on other sites

Hmm... I hadn't tried that altinstall procedure. I'll give it a try once the server load dies down.

 

UPDATE

Okay, it looks like Python 3.2 is run installed at /usr/local/lib/python3.2. Can you please confirm that it is working?

Link to comment
Share on other sites

So the python binary would be at usr/bin/python3.2, I'd assume?

 

Hmm. It looks like cpanel is having some load trouble. I'll try again later. If this works, I would like python 2.7, and I'll need to figure out how to configure mod_wsgi to run with python 2.7.

 

EDIT: I'l assume that 37.00 is a high server load. Are you transferring accounts or something?

 

About the mod-wsgi and different python versions, it looks like it is a server-wide setting. Considering that python is mainly backwards compatible, it should be okay to change it. http://code.google.com/p/modwsgi/wiki/Inst...Python_Versions

 

Just make sure not to use pyth 3.x! :D

 

Oh no. I think I might have done something wrong.

 

I made a simple script to print a simple thing, and then when I ran it, stevie crashed. <_<

Link to comment
Share on other sites

Oh! Yes! We have liftoff! I made a little script that runs cgi.test() and then also added a little bit that prints the python version. (To confirm that I'm using the right one.)

#!/usr/bin/env python3.2
import cgi
cgi.test()
import sys
ver = sys.version_info
print("</br>Python Version:")
print(str(ver.major)+'.'+str(ver.minor)+"."+str(ver.micro))

 

You can check out my results on my account.

http://eap17.heliohost.org/cgi-bin/test2.py

 

If you want to run it, just be sure to have perms 755 on the file for public execution. Given that this works, I think it would be best to follow the same procedure for any other versions. I recommend adding 2.5-2.7, but just 2.7 will work. Also, I wrote above that some special config will need to be made to use python 2.7 with wsgi. I'm sure that this shouldn't cause problems because python is great about keeping depreciated functions and I don't know of any changes to builtins between 2.4 and 2.7.

Link to comment
Share on other sites

To make testing each python version easier, I've made a folder of python test programs that, if the server is running well, will always work.

 

The files are:

 

http://eap17.heliohost.org/pythontests/2.4.py

http://eap17.heliohost.org/pythontests/3.2.py

 

As more python versions get added (I hope) I will add tests here to make it easier for myself and others to confirm that an installation is currently working.

 

Note, for consistency, I'd like to note that users who wish to keep python 2.4 can use:

#!usr/bin/env python2.4

This will always run python 2.4. Of course, I guess tha centOS relies on py2.4, so this probably won't change.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...