title: letsencrypt failed with ImportError: No module named proxy
body: <p>This seems to be vaguely similar to another question, <a href="https://stackoverflow.com/questions/42734006/letsencrypt-failed-with-importerror-no-module-named-interface">"Letsencrypt failed with ImportError: No module named interface,"</a> since it's a similar error message, on "Amazon Linux AMI," except that in this case, it's a different module ("proxy" instead of "interface"), and some of what the other question refers to doesn't even exist. And the other question was back in 2017.</p>
  
  <p>I had certbot-auto working. But two days later, when I found the problems that had been interfering with the DNS challenge (I'd manually put in part of the name that was already being put in automatically), and made another attempt to get a wildcard cert, certbot promptly broke.</p>
  
  <p><strong>When I entered the command (names changed to protect the innocent):</strong></p>
  
  <pre><code>certbot-auto certonly --manual --preferred-challenges DNS -d 'foo.bar.net,*.foo.bar.net'
  </code></pre>
  
  <p><strong>it produced this output:</strong></p>
  
  <pre><code>Upgrading certbot-auto 1.0.0 to 1.1.0…
  Replacing certbot-auto…
  Creating virtual environment…
  Installing Python packages…
  Installation succeeded.
  Traceback (most recent call last):
  File “/opt/eff.org/certbot/venv/bin/letsencrypt”, line 7, in
  from certbot.main import main
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/main.py”, line 2, in
  from certbot._internal import main as internal_main
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/_internal/main.py”, line 10, in
  import josepy as jose
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/init.py”, line 41, in
  from josepy.interfaces import JSONDeSerializable
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/interfaces.py”, line 7, in
  from josepy import errors, util
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/util.py”, line 7, in
  import OpenSSL
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/init.py”, line 8, in
  from OpenSSL import crypto, SSL
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/crypto.py”, line 12, in
  from cryptography import x509
  ImportError: No module named cryptography
  </code></pre>
  
  <p>I then tried the solution given <a href="https://www.bantrain.com/how-to-fix-letsencrypt-upgrade-error-in-amazon-linux-2/?doing_wp_cron=1579566948.4891788959503173828125" rel="nofollow noreferrer">here, for "No module named cryptography" in Amazon Linux 2</a>, but when I entered the final command in that solution,</p>
  
  <pre><code>/opt/eff.org/certbot/venv/local/bin/pip install cryptography interface
  </code></pre>
  
  <p>it complained with</p>
  
  <pre><code>Requirement already satisfied: cryptography in /opt/eff.org/certbot/venv/lib/python2.7/dist-packages
  Exception:
  Traceback (most recent call last):
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pip/basecommand.py”, line 215, in main
  status = self.run(options, args)
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pip/commands/install.py”, line 335, in run
  wb.build(autobuilding=True)
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pip/wheel.py”, line 749, in build
  self.requirement_set.prepare_files(self.finder)
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pip/req/req_set.py”, line 380, in prepare_files
  ignore_dependencies=self.ignore_dependencies))
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pip/req/req_set.py”, line 666, in _prepare_file
  check_dist_requires_python(dist)
  File “/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pip/utils/packaging.py”, line 48, in check_dist_requires_python
  feed_parser.feed(metadata)
  File “/usr/lib64/python2.7/email/feedparser.py”, line 177, in feed
  self._input.push(data)
  File “/usr/lib64/python2.7/email/feedparser.py”, line 99, in push
  parts = data.splitlines(True)
  AttributeError: ‘NoneType’ object has no attribute ‘splitlines’
  </code></pre>
  
  <p>Then, when I tried the original command,</p>
  
  <pre><code>certbot-auto certonly --manual --preferred-challenges DNS -d 'foo.bar.net,*.foo.bar.net'
  </code></pre>
  
  <p>I got</p>
  
  <pre><code>Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt: 
  Traceback (most recent call last):
    File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 7, in &lt;module&gt;
      from certbot.main import main
    File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/main.py", line 2, in &lt;module&gt;
      from certbot._internal import main as internal_main
    File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/_internal/main.py", line 11, in &lt;module&gt;
      import zope.component
    File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope/component/__init__.py", line 23, in &lt;module&gt;
      from zope.component.interfaces import IComponentArchitecture
    File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope/component/interfaces.py", line 21, in &lt;module&gt;
      import zope.deferredimport
    File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope/deferredimport/__init__.py", line 1, in &lt;module&gt;
      from zope.deferredimport.deferredmodule import initialize
    File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope/deferredimport/deferredmodule.py", line 18, in &lt;module&gt;
      import zope.proxy
  ImportError: No module named proxy
  </code></pre>
  
  <p>I looked at the "No module named interface" question, but where it asks to do things with </p>
  
  <pre><code>/root/.local/share/letsencrypt
  </code></pre>
  
  <p>I can't find any such directory as "/root/.local" nor "/home/ec2-user/.local" nor "/.local"; if I go to the file system root and do </p>
  
  <pre><code>find -name letsencrypt
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>./var/lib/letsencrypt
  ./var/log/letsencrypt
  ./etc/letsencrypt
  ./opt/eff.org/certbot/venv/lib/python2.7/dist-packages/letsencrypt
  ./opt/eff.org/certbot/venv/bin/letsencrypt
  ./opt/trac-1.2.3-11/letsencrypt
  </code></pre>
  
  <p>Can somebody shed some light on this?</p>