I assume you are using the CentOS system Python as it would be difficult to install a different (up-to-date) python without access to gcc
.
Setup a VM (e.g. in VirtualBox) with the exact same CentOS version, hosted on a different machine. In that VM install the required gcc
, and install virtualenv
( I recommend doing that from source, the one you can install with your package manager is quite often outdated).
On the VM, create a virtual environment e.g. with virtualenv /opt/util/pymssql
, this virtual environment will have references to the real python but since you are going to move it to an equivalent CentOS, that is ok.
Activate the environment ( source /opt/util/pymssql/bin/activate
) and use pip
to install all the libraries that you need.
When all is installed and working, tar
the /opt/util/pymssql
and its subdirectories and put it on the "real" CentOS machine in the same location. That should give you working code without a compiler on the "real" machine.
The actual directory (in the example /opt/util/pymssql
) for the virtual environment is not important, but you have to use the path that will be used on the "real" machine, some of the files in the virtual env will have the path hardcoded.