Python on the CS Webservers
Python is supported as a CGI program on the CS Department webservers, but there are a few things you should know about it.
You may also want to read about Python on the CS Linux Clients.
Python Versions
The webservers have both Python 3 and Python 2 available. As of February 2021, the webservers are specifically using Python 3.6. This is different from the Linux clients, which use a newer version. If you're writing programs to run on one of the department webservers, we recommend you restrict those programs to use only features available in the webservers' version of Python 3.
The default Python version (what you get when you run the python
program) is Python 3. If you want Python 2, you must specify it explicitly by using python2
at the top of your program. Python 2 will be removed from our web servers at some future date no later than the summer of 2029. (Note that Python2 will not be on our Linux clients after summer 2025.)
It's good practice to explicitly use python3
when you intend to use Python 3. Using python
by itself is only recommended in a handful of situations that mostly don't apply to our webservers.
Python Packages
The set of Python packages installed on the webservers is fairly minimal. If you need a package that's not installed, you should first try installing it yourself into your home directory, using our self-installation instructions. If that does not work, you can contact us at support@cs.jhu.edu for assistance, but be aware that we are not be able to install every requested package.
Deployment Options
For technical reasons, we do not support WSGI. You will have to run your Python programs as either CGI or FastCGI programs. (Most major Python web frameworks support FastCGI deployment; see their documentation for details.)