Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Django Basics Say Hello to Django Django?

Python Version Support

I'm trying to make a blog using a Django tutorial, but I noticed that my hosting provider, namescheap, mentions support for Python 2.6 as the latest version. Does that mean I'll have to develop the blog in a Python 2.6 workspace? Also, is it possible to update my server with one of the more recent versions of Python environments, or is that something limited by hosting providers?

1 Answer

Chris Freeman
Chris Freeman
Treehouse Moderator 67,989 Points

Send their support team a message asking to them to support Python 2.7. With enough prodding they may update. Python 2.6.9, released Oct 2013, is old. Python 2.7 has been out since July 2010, with 2.7.9 out December 2014, and the latest 2.7.10 released in May 2015!

Python can run from any directory. If you have write permissions, you may install it in a local directory if needed, or in a virtualenv directory.

To uses Django 1.8 or 1.9, Python 2.7 is required. Django 1.7 is no longer supported.

To install python locally you can:

# Install Python as ~/local/bin/python2.7
# create local installed directory
$ cd ~
$ mkdir local

# create local directory for the source
$ cd ~
$ mkdir src
$ cd src

#  Fetch, extract, compile, and install the Python 2.7.10 source code:
$ wget http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
$ tar -xzvf Python-2.7.10.tgz
$ cd Python-2.7.10
$ ./configure -prefix=/home/<username>/local
$ make
$ make install

# view installed directory
$ ls ~/local/bin
2to3  pydoc   python2    python2.7-config  python-config
idle  python  python2.7  python2-config    smtpd.py

# Add your local bin to the path (add to .bashrc or equivalent)
$ PATH="/home/<username>/local/bin:$PATH"