title: Error Installing python-ldap package
body: <p>I'm trying to install the python-ldap package with PyCharm and it is not working out, i get the following error:</p>
  
  <p><a href="https://i.stack.imgur.com/spWi1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/spWi1.png" alt="enter image description here"></a></p>
  
  <p>Error Message:</p>
  
  <p>Collecting python-ldap
    Using cached <a href="https://files.pythonhosted.org/packages/7f/1c/28d721dff2fcd2fef9d55b40df63a00be26ec8a11e8c6fc612ae642f9cfd/python-ldap-3.1.0.tar.gz" rel="nofollow noreferrer">https://files.pythonhosted.org/packages/7f/1c/28d721dff2fcd2fef9d55b40df63a00be26ec8a11e8c6fc612ae642f9cfd/python-ldap-3.1.0.tar.gz</a>
  Collecting pyasn1>=0.3.7 (from python-ldap)
    Using cached <a href="https://files.pythonhosted.org/packages/a0/70/2c27740f08e477499ce19eefe05dbcae6f19fdc49e9e82ce4768be0643b9/pyasn1-0.4.3-py2.py3-none-any.whl" rel="nofollow noreferrer">https://files.pythonhosted.org/packages/a0/70/2c27740f08e477499ce19eefe05dbcae6f19fdc49e9e82ce4768be0643b9/pyasn1-0.4.3-py2.py3-none-any.whl</a>
  Collecting pyasn1_modules>=0.1.5 (from python-ldap)
    Using cached <a href="https://files.pythonhosted.org/packages/e9/51/bcd96bf6231d4b2cc5e023c511bee86637ba375c44a6f9d1b4b7ad1ce4b9/pyasn1_modules-0.2.1-py2.py3-none-any.whl" rel="nofollow noreferrer">https://files.pythonhosted.org/packages/e9/51/bcd96bf6231d4b2cc5e023c511bee86637ba375c44a6f9d1b4b7ad1ce4b9/pyasn1_modules-0.2.1-py2.py3-none-any.whl</a>
  Installing collected packages: pyasn1, pyasn1-modules, python-ldap
    Running setup.py install for python-ldap: started
      Running setup.py install for python-ldap: finished with status 'error'
      Complete output from command C:\Users\Joan\PycharmProjects\prueba\venv\Scripts\python.exe -u -c "import setuptools, tokenize;<strong>file</strong>='C:\Users\Joan\AppData\Local\Temp\pycharm-packaging\python-ldap\setup.py';f=getattr(tokenize, 'open', open)(<strong>file</strong>);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, <strong>file</strong>, 'exec'))" install --record C:\Users\Joan\AppData\Local\Temp\pip-record-y2ot_u84\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Joan\PycharmProjects\prueba\venv\include\site\python3.6\python-ldap:
      running install
      running build
      running build_py
      creating build\lib.win-amd64-3.6
      copying Lib\ldapurl.py -> build\lib.win-amd64-3.6
      copying Lib\ldif.py -> build\lib.win-amd64-3.6
      creating build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\async.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\asyncsearch.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\cidict.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\compat.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\constants.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\dn.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\filter.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\functions.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\ldapobject.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\logger.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\modlist.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\pkginfo.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\resiter.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\sasl.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap\syncrepl.py -> build\lib.win-amd64-3.6\ldap
      copying Lib\ldap__init__.py -> build\lib.win-amd64-3.6\ldap
      creating build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\deref.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\libldap.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\openldap.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\pagedresults.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\ppolicy.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\psearch.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\pwdpolicy.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\readentry.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\sessiontrack.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\simple.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\sss.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls\vlv.py -> build\lib.win-amd64-3.6\ldap\controls
      copying Lib\ldap\controls__init__.py -> build\lib.win-amd64-3.6\ldap\controls
      creating build\lib.win-amd64-3.6\ldap\extop
      copying Lib\ldap\extop\dds.py -> build\lib.win-amd64-3.6\ldap\extop
      copying Lib\ldap\extop__init__.py -> build\lib.win-amd64-3.6\ldap\extop
      creating build\lib.win-amd64-3.6\ldap\schema
      copying Lib\ldap\schema\models.py -> build\lib.win-amd64-3.6\ldap\schema
      copying Lib\ldap\schema\subentry.py -> build\lib.win-amd64-3.6\ldap\schema
      copying Lib\ldap\schema\tokenizer.py -> build\lib.win-amd64-3.6\ldap\schema
      copying Lib\ldap\schema__init__.py -> build\lib.win-amd64-3.6\ldap\schema
      creating build\lib.win-amd64-3.6\slapdtest
      copying Lib\slapdtest_slapdtest.py -> build\lib.win-amd64-3.6\slapdtest
      copying Lib\slapdtest__init__.py -> build\lib.win-amd64-3.6\slapdtest
      running egg_info
      writing Lib\python_ldap.egg-info\PKG-INFO
      writing dependency_links to Lib\python_ldap.egg-info\dependency_links.txt
      writing requirements to Lib\python_ldap.egg-info\requires.txt
      writing top-level names to Lib\python_ldap.egg-info\top_level.txt
      reading manifest file 'Lib\python_ldap.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      no previously-included directories found matching 'Doc.build'
      writing manifest file 'Lib\python_ldap.egg-info\SOURCES.txt'
      creating build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\README -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\ca.conf -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\ca.pem -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\client.conf -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\client.key -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\client.pem -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\gencerts.sh -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\gennssdb.sh -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\server.conf -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\server.key -> build\lib.win-amd64-3.6\slapdtest\certs
      copying Lib\slapdtest\certs\server.pem -> build\lib.win-amd64-3.6\slapdtest\certs
      warning: build_py: byte-compiling is disabled, skipping.</p>
  
  <pre><code>running build_ext
  building '_ldap' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\Modules
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.1.0 "-DLDAPMODULE_AUTHOR=python-ldap project" "-DLDAPMODULE_LICENSE=Python style" -IModules -IC:\Users\Joan\PycharmProjects\prueba\venv\include -IC:\Users\Joan\AppData\Local\Programs\Python\Python36\include -IC:\Users\Joan\AppData\Local\Programs\Python\Python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /TcModules/LDAPObject.c /Fobuild\temp.win-amd64-3.6\Release\Modules/LDAPObject.obj
  LDAPObject.c
  c:\users\joan\appdata\local\temp\pycharm-packaging\python-ldap\modules\constants.h(7): fatal error C1083: Cannot open include file: 'lber.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
  
  ----------------------------------------
  </code></pre>
  
  <p>Command "C:\Users\Joan\PycharmProjects\prueba\venv\Scripts\python.exe -u -c "import setuptools, tokenize;<strong>file</strong>='C:\Users\Joan\AppData\Local\Temp\pycharm-packaging\python-ldap\setup.py';f=getattr(tokenize, 'open', open)(<strong>file</strong>);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, <strong>file</strong>, 'exec'))" install --record C:\Users\Joan\AppData\Local\Temp\pip-record-y2ot_u84\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Joan\PycharmProjects\prueba\venv\include\site\python3.6\python-ldap" failed with error code 1 in C:\Users\Joan\AppData\Local\Temp\pycharm-packaging\python-ldap\</p>
  
  <p>I'll appreciate all the help, </p>
  
  <p>thank you in advance!</p>