简体   繁体   中英

Installing python-ldap in a virtualenv on Windows

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM