Let’s Encrypt: How to Upgrade to Python 2.7 in Centos 6

Let’s Encrypt will soon no longer support Python 2.6 due to its security update and the depreciate error prompted when running letsencrypt-auto script.

Here is how to install Python 2.7 in CentOS 6 (can be done on CentOS 7 too) and enable Let’s Encrypt to use Python 2.7 environment.

Install Python 2.7 in Centos

Grab latest Python 2.7 from https://www.python.org/ftp/python, when we write this tutorial, it’s version 2.7.9, it could be different version when you found this tutorial.

We will do a wget for 2.7.9 python installation files.

After file being downloaded let’s un-xz and un-tar it.

Change into the directory and start compile & install Python 2.7 in CentOS 6/7 box

Python 2.7 binary will be installed into /usr/local/bin

Basically the installation of Python 2.7 is done. Next will need to re-configure Let’s Encrypt python environment.

Re-Configure Let’s Encrypt Environment for Python 2.7

The environment files is installed in /root/.local/share/letsencrypt

We will rename the files in /root/.local into other name

Next, go to Let’s Encrypt folder to re-run the install by invoking this command

Ignore the error, if you do not have any cert created before. To confirm it’s now created Python 2.7 environment, go to the lib folder to take a look.


Another question is can you install Python version > 2.7 for Let’s Encrypt? We think it cannot be done, it’s became letsencrypt-auto only search for python2 or python2.7 binary in your environment (/bin /usr/local/bin). As long as you didn’t see the depreciate error like below, Let’s Encrypt should work fine 😉