[SOLVED] Installing python 2.7.x and pymssql

Issues related to software problems.
Post Reply
egrimisu
Posts: 2
Joined: 2015/06/10 20:47:05

[SOLVED] Installing python 2.7.x and pymssql

Post by egrimisu » 2015/06/10 20:54:13

Hi guys,

This is my first post here and the first time that i use a centos os. I have a FAN system at work (Fully Automated Nagios) and we need to monitor MSSQL Jobs. The plugin developed by the nagios community requires python 2.7 and pymssql module, unfortuenttly i wasn't able to install it, since i use a VM i have done some snapshot and REALY tried a lot of guides found on the web but did not work, can i find a guide that realy work?

I think there are some limitation also, the current python version that i use is 2.4.3 and i believe that i need to keep it also, some nagion plugins are limite to 2.4.x (if I recall well)

Thanks in advance.

User avatar
TrevorH
Forum Moderator
Posts: 26887
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Installing python 2.7.x and pymssql

Post by TrevorH » 2015/06/10 21:22:30

The IUS Community repository for CentOS 5 has some python27 packages available. These are parallel install packages so go alongside the system python (which you should not overwrite unless you want to break your system). You should be able to change the python interpreter that it uses just by changing the shebang line at the top of the script you need to execute.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

egrimisu
Posts: 2
Joined: 2015/06/10 20:47:05

Re: [SOLVED] Installing python 2.7.x and pymssql

Post by egrimisu » 2015/06/11 07:56:50

TrevorH wrote:The IUS Community repository for CentOS 5 has some python27 packages available. These are parallel install packages so go alongside the system python (which you should not overwrite unless you want to break your system). You should be able to change the python interpreter that it uses just by changing the shebang line at the top of the script you need to execute.
Hi and thanks for the quick answer,
worked as expected;

Code: Select all

wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/5/x86_64/ius-release-1.0-14.ius.centos5.noarch.rpm
sudo rpm -Uvh ius-release*.rpm
yum install python27 python27-pip
pip2.7 install ppmssql
and change the script from:

Code: Select all

#!/usr/bin/env python
to:

Code: Select all

#!/usr/bin/env python2.7

Post Reply

Return to “CentOS 5 - Software Support”