Error on virtualenv.py when using certbot-auto --apache


#1

I’m trying to run the certbot-auto --apache command on my Ubuntu server but I’m running into this error:

Creating virtual environment…
Traceback (most recent call last):
File “/usr/lib/pymodules/python2.6/virtualenv.py”, line 1495, in
main()
File “/usr/lib/pymodules/python2.6/virtualenv.py”, line 537, in main
use_setuptools=options.use_setuptools)
File “/usr/lib/pymodules/python2.6/virtualenv.py”, line 628, in create_environment
install_distribute(py_executable, unzip=unzip_setuptools)
File “/usr/lib/pymodules/python2.6/virtualenv.py”, line 364, in install_distribute
_install_req(py_executable, unzip, distribute=True)
File “/usr/lib/pymodules/python2.6/virtualenv.py”, line 337, in _install_req
cwd=cwd)
File “/usr/lib/pymodules/python2.6/virtualenv.py”, line 598, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /opt/eff.org/certbot/venv/bin/python2 -c “#!python
”"“Bootstrap distribu…1:])
” --always-copy -U distribute failed with error code 1

I couldn’t seem to find anyone else who had run into a similar issue and I’m kind of at a loss for what to do about it. Any help would be appreciated :slight_smile: thanks


#2

Hi @twistedsymphony,

What version of Ubuntu is this? Is it one that is no longer supported by the Ubuntu developers?

We have recently removed Certbot support for Python 2.6 and it seems likely to me that if your only available Python version is 2.6, you might be on a distribution version whose developers consider it obsolete and recommend upgrading. But you might also be able to address the problem by installing a newer version of Python, if one is available.


#3

Thanks for the reply. I am using an older, no longer supported, version of Ubuntu. I managed to upgrade Python to 2.7. When running the script now I get this:

Creating virtual environment…
Traceback (most recent call last):
File “/opt/eff.org/certbot/venv/lib/python2.7/site.py”, line 67, in
import os
File “/opt/eff.org/certbot/venv/lib/python2.7/os.py”, line 49, in
import posixpath as path
File “/opt/eff.org/certbot/venv/lib/python2.7/posixpath.py”, line 17, in
import warnings
ImportError: No module named warnings


#4

What’s your actual Ubuntu version / lsb_release -a ?

If you’re using an ancient distro, you may also run into other kinds of problems, like very old OpenSSL versions.

You could try some Let’s Encrypt clients have simpler/no system dependencies, like acmetool or lego.


#5

I believe it’s 10.04


#6

I would strongly suggest giving up and using a more modern host to terminate SSL for your old one, or at the very least use one of the (much, much) more simple to install ACME clients I recommended above.

It is in no uncertain terms an awful idea to try and use Certbot on a system this old. Even the Python ecosystem doesn’t support your OS anymore.

Anyway this is how I got certbot-auto working on Ubuntu Lucid / 10.04.

  1. Install Python 2.7 from a third party PPA. or from source.

  2. Install distribute from tarball using Python 2.7:

    python2.7 setup.py install
    
  3. Install a newer version of pip, because the one that comes with Lucid is is no longer compatible with the Python repositories.

    easy_install-2.7 pip==9.0.1
    
  4. Then, run certbot-auto:

    rm -rf /opt/eff.org/certbot
    ./certbot-auto certonly -d example.org

#7

After doing that I’m still getting the “ImportError: No module named warnings” as before. Searching around this seems to be an issue when upgrading the virtual environment after upgrading python 2.6 to python 2.7.

I’m also seeing if my host is willing to upgrade me to a newer OS.


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.