Koozali.org: home of the SME Server

Obsolete Releases => SME Server 8.x => Topic started by: Bud on August 21, 2015, 01:17:08 PM

Title: Upgrade to Python 2.7.3
Post by: Bud on August 21, 2015, 01:17:08 PM
please guys i need your help

is there any way i can upgrade SME 8.1 server to use Python 2.7.3

how?

any help greatly appreciated  :-)
Title: Re: Upgrade to Python 2.7.3
Post by: CharlieBrady on August 21, 2015, 02:26:54 PM
If you want later versions of software, then you should be using SME9, not SME 8.x.

With SME9 64bit, you can install python27 from:

https://www.softwarecollections.org/repos/rhscl/python27/epel-6-x86_64/

or python33 from:

https://www.softwarecollections.org/repos/rhscl/python33/epel-6-x86_64/

AFAIK, there is no simple way to upgrade python on either SME8.1 or SME9.
Title: Re: Upgrade to Python 2.7.3
Post by: mmccarn on August 22, 2015, 02:47:13 PM
I'm using python 2.7.9 on my SME 8.1 server that I installed using the instructions in the wiki:
http://wiki.contribs.org/Python_Altinstall

As Charlie says - it's not simple.

Also, as mentioned on the wiki page:
Quote
Warning:

This procedure requires installation of gcc and could significantly compromise your server's security.
Thorough understanding of linux system management is required.

Proceed at your own risk

If you decide to proceed, be sure to read the section on Important Server Security and Administration Implications (http://wiki.contribs.org/Python_Altinstall#Important_Server_Security_and_Administration_Implications).  You will need to establish a process to monitor every non-standard package you install for updates and vulnerabilities.
Title: Re: Upgrade to Python 2.7.3
Post by: Bud on August 25, 2015, 01:05:45 AM
CharlieBrady and mmccarn thank you very much for your help

i have built a new sme 9 64bit server and have installed python as per http://wiki.contribs.org/Python_Altinstall

when i do a # python -V i get Python 2.6.6

how can i find out if Python 2.7.9 is installed successfully?

how would i make Python 2.7.9 my default python on the sme 9 64bit system

thanks again  :-)
Title: Re: Upgrade to Python 2.7.3
Post by: Stefano on August 25, 2015, 01:49:02 AM
I can't answer your question but be aware that running a different python version as the default one could break yum..
Title: Re: Upgrade to Python 2.7.3
Post by: CharlieBrady on August 25, 2015, 02:06:42 AM
i have built a new sme 9 64bit server and have installed python as per http://wiki.contribs.org/Python_Altinstall

I think installing python27 or python33 rpms from softwarecollections is a simpler and safer approach.

Title: Re: Upgrade to Python 2.7.3
Post by: Bud on August 25, 2015, 06:32:37 AM
Stefano thank you i understand

CharlieBrady much appreciated for your input. So i need to download all the rpm's from http://wiki.contribs.org/Python_Altinstall and install on sme 9 server. is that correct?

i can see that python 2.7.9 is installed in /usr/local/bin/python2.7

if i create a shell alias ie: # alias python=/usr/local/bin/python2.7 - will / should that work in the event of an app requiring python 2.7 ?

thanks again guys much appreciated  :-)
Title: Re: Upgrade to Python 2.7.3
Post by: guest22 on August 25, 2015, 06:56:54 AM
As per Charlies suggestion, I also would suggest to start reading this: http://wiki.contribs.org/Software_Collections:Python (http://wiki.contribs.org/Software_Collections:Python)
Title: Re: Upgrade to Python 2.7.3
Post by: CharlieBrady on August 25, 2015, 04:06:32 PM
So i need to download all the rpm's from http://wiki.contribs.org/Python_Altinstall and install on sme 9 server. is that correct?

No. I am suggesting that you install rpms from softwarecollections.org, and ignore Python_Altinstall.
Title: Re: Upgrade to Python 2.7.3
Post by: Bud on August 25, 2015, 04:39:17 PM
CharlieBrady thank you i understand

my question is how can i get the update done in one go by download all rpm's from the site and installing all rpm's with one command on the sme 9 server.

will it upgrade and replace python 2.6?

thanks again for your help  :-)
Title: Re: Upgrade to Python 2.7.3
Post by: Stefano on August 25, 2015, 04:59:30 PM
please, read carefully here:

http://wiki.contribs.org/Software_Collections_Repositories (http://wiki.contribs.org/Software_Collections_Repositories)

and follow the directions you find here:
http://wiki.contribs.org/Software_Collections (http://wiki.contribs.org/Software_Collections)


and here:

http://wiki.contribs.org/Software_Collections:Python
Title: Re: Upgrade to Python 2.7.3
Post by: stephdl on August 25, 2015, 06:25:44 PM
software collection will never remove the version of your server, it will install belong the default version to the /opt.

follow instructions at http://wiki.contribs.org/Software_Collections:Python
Title: Re: Upgrade to Python 2.7.3
Post by: Xavier.A on August 25, 2015, 08:28:14 PM
Bud :

I don't know if there are many Python devs here but as i'm teaching python i will try to give you some advices.

From my point of view, the way you install Python is not the most important point. it's how you will use it and how you will install all the dependencies for your project. You won't be able to resolve all the dependencies you will need if you install Python with the RH software collections repos.

Despite the way you install Python, you have to know how to use the virtual environment for Python, "pip" and "easy_install".

Python is not Perl, for Python devs there is only one way to do the things: the best one !

A+
Title: Re: Upgrade to Python 2.7.3
Post by: Bud on September 09, 2015, 05:39:25 AM
guys thank you for your help

i have install python27 however i am having one problem

when i do
# scl -l
php54
php55
php56
python27

So it shows that python27 is installed, however when i issue
# scl enable python27 bash
bash: cl: command not found

when i issue
# python --version
Python 2.6.6

any ideas what to look for, please help  :-)
Title: Re: Upgrade to Python 2.7.3
Post by: Bud on September 10, 2015, 06:32:28 AM
good day guys

it seems that the "link" to python 2.7.3 is broken as i cannot issue a command that will execute with the correct version of python.

any help on this please  :-)
Title: Re: Upgrade to Python 2.7.3
Post by: guest22 on September 10, 2015, 07:21:55 AM
Please read the wiki carefully. Especially the part where you set the environment variables to use the 'new' version of Python.