Search code examples
pythonpython-2.7pippython-2.6sles

How to Set Up Multiple Installations of Python on SLES


I am working on a Python project at work and I have been testing on my local machine. I now have to test a section of code which sends emails, but I cannot do this from my laptop because of the Firewall. So, I have to copy it over to one of the dev servers, which runs SUSE Linux Enterprise Server(SLES) 11 SP4, and test it from there. Also, eventually this script will be run from one of the production servers, so it'll be good for me to set this up on a dev server and then be able to duplicate the process for the prod server. So, the issue is that the dev server has Python2.6 with no packages, no pip, no easy_install, nothing. I tried installing pip and some other things, but to no avail due to an error stating that Python2.6 is no longer supported. I want Python2.7 with pip because that's what I've been using on my computer for testing, and so I can install the packages I need like smtplib, requests, re, email, sys, and getpass. How do I install Python2.7 and make it the default for when I run my script? Please keep in mind, Python2.6 is being used by some older scripts, so I cannot uninstall it or upgrade it to 2.7. Thank you in advance to anyone who can help!


Solution

  • Use Miniconda for managing your development environment. You can install it locally and it has a self contained python environment akin to virtualenv but with the added bonus that you can install more than just python packages into it (C extensions for example).