如何修复OpenSSL包中Ubuntu服务器上的AttributeError?

如何修复OpenSSL包中Ubuntu服务器上的AttributeError?,ubuntu,openssl,webserver,lets-encrypt,certbot,Ubuntu,Openssl,Webserver,Lets Encrypt,Certbot,调用certbot时出错: root@freshgarden:~# sudo certbot certonly --standalone --preferred-challenges http -d greengarden.propulsion-learn.ch Traceback (most recent call last): File "/usr/bin/certbot", line 11, in <module> load_entry_poin

调用certbot时出错:

root@freshgarden:~# sudo certbot certonly --standalone --preferred-challenges http -d greengarden.propulsion-learn.ch
Traceback (most recent call last):
  File "/usr/bin/certbot", line 11, in <module>
    load_entry_point('certbot==0.31.0', 'console_scripts', 'certbot')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2324, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/certbot/main.py", line 10, in <module>
    import josepy as jose
  File "/usr/lib/python3/dist-packages/josepy/__init__.py", line 44, in <module>
    from josepy.interfaces import JSONDeSerializable
  File "/usr/lib/python3/dist-packages/josepy/interfaces.py", line 8, in <module>
    from josepy import errors, util
  File "/usr/lib/python3/dist-packages/josepy/util.py", line 4, in <module>
    import OpenSSL
  File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 675, in <module>
    _lib.Cryptography_HAS_TLSEXT_HOSTNAME, "SNI not available"
AttributeError: module 'lib' has no attribute 'Cryptography_HAS_TLSEXT_HOSTNAME'
name: backend
dependencies:
  - Python==3.8.5
  - pip
  - psycopg2
  - pip:
    - Django==3.1.2
    - djangorestframework==3.12.1
    - djangorestframework-simplejwt==4.4.0
    - django-any-imagefield==1.1
    - Pillow==7.2.0
    - flake8==3.8.4
    - gunicorn==20.0.4
    - django-cors-headers==3.5.0
    - django-shopping-cart==0.1
    - cryptography==2.3