certbot / certbot

Certbot is EFF's tool to obtain certs from Let's Encrypt and (optionally) auto-enable HTTPS on your server. It can also act as a client for any other CA that uses the ACME protocol.
Other
31.35k stars 3.39k forks source link

letsencrypt-auto fails to install virtualenv #2966

Closed spookylukey closed 8 years ago

spookylukey commented 8 years ago

Following the instructions on https://letsencrypt.org/getting-started/ , from a fresh git clone I get this when I try to run "./letsencrypt-auto"

Creating virtual environment...
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2304, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 705, in main
    symlink=options.symlink)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 924, in create_environment
    download=download,
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 843, in install_wheel
    cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
  File "/usr/lib/python2.7/pkgutil.py", line 578, in get_data
    loader = get_loader(package)
  File "/usr/lib/python2.7/pkgutil.py", line 464, in get_loader
    return find_loader(fullname)
  File "/usr/lib/python2.7/pkgutil.py", line 474, in find_loader
    for importer in iter_importers(fullname):
  File "/usr/lib/python2.7/pkgutil.py", line 430, in iter_importers
    __import__(pkg)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/__init__.py", line 13, in <module>
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/utils/__init__.py", line 26, in <module>
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 3130, in <module>
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 3116, in _call_aside
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 3155, in _initialize_master_working_set
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 956, in subscribe
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 3155, in <lambda>
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 2655, in activate
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 2225, in declare_namespace
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 2194, in _handle_ns
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 2192, in sort_key
ValueError: '/usr/local/lib/python2.7/dist-packages' is not in list

This is on Ubuntu 14.04.

Attempting to install manually (by creating a virtualenv and running "python setup.py develop" from the checkout) also fails, because requirement "acme==0.6.0.dev0" does not exist on PyPI (this is a separate bug it seems).

Plus, there is then no "letsencrypt" script, but "certbot" instead.

Overall, installation experience via anything but official packages is pretty much a disaster. Wouldn't a standard 'pip' installable package be much better?

pde commented 8 years ago

There is a pip package you can install, but letsencrypt-auto (which is in the process of becoming certbot-auto) is intended to prevent pip from creating a weird state where some of your python packages come from your OS, and others are installed by pip in /usr/local/bin/.

pde commented 8 years ago

In fact, looking at your error traceback, there's a reasonable chance that that's the exact reason you're encountering this problem... you have some python libraries related to pip and virtualenv installed in /usr/local/, and you may have problematic versions of those.

pde commented 8 years ago

Maybe try uninstalling the version of pip that you have in /usr/local/, or updating it to the latest version.

pde commented 8 years ago

Meanwhile, I can't reproduce this on a stock 14.04 VPS.

pde commented 8 years ago

(The reason your python setup.py develop command didn't work is that 0.6.0dev0 is the pre-release in git, not an actual stable release that's in PyPI yet. If you want to run 0.6.0dev0 from git, instructions are here:

https://letsencrypt.readthedocs.io/en/latest/contributing.html#running-a-local-copy-of-the-client )