Phython returned non-zero exit status 2


When trying:
./certbot-auto certonly --standalone --email --agree-tos -d

Checking for new version…
Creating virtual environment…
Installing Python packages…
Traceback (most recent call last):
File “/tmp/tmp.lZwwFi6TvF/”, line 146, in
File “/tmp/tmp.lZwwFi6TvF/”, line 133, in main
File “/usr/lib/python2.7/”, line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command ‘pip install --no-index --no-deps -U /tmp/pipstrap-xcfZLh/pip-8.0.3.tar.gz /tmp/pipstrap-xcfZLh/setuptools-20.2.2.tar.gz /tmp/pipstrap-xcfZLh/wheel-0.29.0.tar.gz’ returned non-zero exit status 2


updated pip,

root@ns1 ~/downloads/certbot # pip install --upgrade pip
Downloading/unpacking pip from
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.4
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed pip
Cleaning up...

but I still get the same error.


Does nobody know what to do?


ok. I just did

tar -vzxf pip-1.5.6.tar.gz
cd pip-1.5.6
python install

now I get

Creating virtual environment...
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/", line 2339, in <module>
  File "/usr/lib/python2.7/dist-packages/", line 825, in main
  File "/usr/lib/python2.7/dist-packages/", line 993, in create_environment
    install_wheel(to_install, py_executable, search_dirs)
  File "/usr/lib/python2.7/dist-packages/", line 961, in install_wheel
    'PIP_NO_INDEX': '1'
  File "/usr/lib/python2.7/dist-packages/", line 903, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /root/.local/share/letsencrypt/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1


Looking at this certbot issue that may be resolved by correctly setting the language

export LC_ALL="en_US.UTF-8"
export LC_CTYPE=“en_US.UTF-8”


Thanks for your help! Unfortunately it didn’t resolve it. Still setuptools pip failed with error code 1


Not sure it’s related, but a number of people have needed to reboot a server after upgrading pip …


Unfortunately it didn’t solve my case.


Unfortunately I don’t use certbot myself, I use one of the other clients. It may be worth posting as an issue on the certbot github site.


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