关于启动报错ModuleNotFoundError:No module named ‘python-ldap‘

安装:

pip install python-ldap==3.4.0

安装报错:

/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
Collecting python-ldap==3.4.0
  Downloading python-ldap-3.4.0.tar.gz (376 kB)
     |████████████████████████████████| 376 kB 17 kB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: pyasn1-modules>=0.1.5 in /usr/lib/python3/dist-packages (from python-ldap==3.4.0) (0.2.1)
Requirement already satisfied: pyasn1>=0.3.7 in /usr/lib/python3/dist-packages (from python-ldap==3.4.0) (0.4.2)
Building wheels for collected packages: python-ldap
  Building wheel for python-ldap (PEP 517) ... error

ERROR: Failed building wheel for python-ldap

解决方法:

sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev

pip install python-ldap==3.4.0

你可能感兴趣的:(python,开发语言)