Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

django - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 pathoyour.whl
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...