6
votes

I'm working on a Django project that is using an ldap authentication module. This is working on our server but I am running into issues getting this running on my windows dev machine.

My environment is using virtualevn and when trying to install pip python-ldap I receive the following message:

error: Unable to find vcvarsall.bat

Does anyone have any idea what could be going wrong?

2

2 Answers

11
votes

Unfortunately, many Python modules have trouble installing on Windows. The error you're receiving is one that I was never able to get fixed, even given the vast amount of information available on the web. Give this link a try for a pre-compiled version: http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap

16
votes

To expand on @Brandon's answer, to install using the pre-built wheel:

  1. Ensure you have pip 19.2+ installed:

    $ pip --version
    pip 19.2.3
    
  2. Check your Python version and architecture (32/64 bit) https://stackoverflow.com/a/10966396/1026:

    $ python -c 'import sys; print(sys.version)'
    3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
    
  3. Download the matching pre-built *.whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap

    For example given the above Python I picked "python_ldap‑3.2.0‑cp37‑cp37m‑win_amd64.whl"

  4. Install it with:

    pip install path\to\your.whl