Install "pas.plugins.ldap" Plone breaks on Windows

Hello to the community,
I'm having a big problem after installing pas.plugins.ldap
under Plone 5.1.5 Windows server 2016.
Indeed, I wanted to set up the authentication under plone via Windows Active Directory.
For the installation of pas.plugins.ldap, I do this
I add to the buildout instance section:

eggs =
    ...
    pas.plugins.ldap

zcml =
    ...
    pas.plugins.ldap "

then bin / buildout.
It seems that this has literally broken Plone. Indeed, it is impossible to launch the server (instace fg or console instance) and thus to access again
in Plone.
Here is the error message when I try to launch the server plone.

-----
Microsoft Windows [version 10.0.14393]
(c) 2016 Microsoft Corporation. Tous droits réservés.
C:\Users\Administrateur>cd Plone
C:\Users\Administrateur\Plone>cd zinstance
C:\Users\Administrateur\Plone\zinstance>cd bin
C:\Users\Administrateur\Plone\zinstance\bin>instance console
Error: error opening file C:\Users\Administrateur\Plone\zinstance\parts\instance\etc\zope.conf: [Error 3] Le chemin dÆaccÞs spÚcifiÚ est introuvable: 'C:\\Users\\Administrateur\\Plone\\zinstance\\parts\\instance\\etc\\zope.conf'
For help, use C:\Users\Administrateur\Plone\zinstance\bin\instance-script.py -h
C:\Users\Administrateur\Plone\zinstance\bin>instance fg
Error: error opening file C:\Users\Administrateur\Plone\zinstance\parts\instance\etc\zope.conf: [Error 3] Le chemin dÆaccÞs spÚcifiÚ est introuvable: 'C:\\Users\\Administrateur\\Plone\\zinstance\\parts\\instance\\etc\\zope.conf'
For help, use C:\Users\Administrateur\Plone\zinstance\bin\instance-script.py -h
C:\Users\Administrateur\Plone\zinstance\bin>instance-script.py -h
Traceback (most recent call last):
  File "C:\Users\Administrateur\Plone\zinstance\bin\instance-script.py", line 264, in <module>
    import plone.recipe.zope2instance.ctl
  File "c:\users\administrateur\plone\buildout-cache\eggs\plone.recipe.zope2instance-4.4.1-py2.7.egg\plone\recipe\zope2instance\__init__.py", line 23, in <module>
    import zc.buildout
ImportError: No module named buildout
C:\Users\Administrateur\Plone\zinstance\bin>
-------- 

Given the error message, I check the folder "parts": it is now empty!
As soon as I replace the "parts" folder with the original backup at the time of Plone installation, I can access the Plone interface again.
My question is :

  • "pas.plugins.ldap" is it compatible with Windows?
  • can we for example replace it with ldap3?
  • does ldap3 have the same functions as not.plugins.ldap?
  • someone has an idea of ​​the problem?
    Thanks in advance
  1. The bin/buildout output could be useful. The problem does look more general buildout related.

  2. pas.plugins.ldap is not tested on windows, but it is pure Python. So it should work on Windows if its dependencies do, primary python-ldap. It has no official Windows support, but there are unofficial well managed recent binaries around, see https://www.python-ldap.org/en/latest/installing.html#windows
    Install them manually using bin/pip prior buildout, then run bin/buildout.
    If this works (or does not work) I would appreciate a short report here.

  3. Connectivity to ActiveDirectory is supported.

Hello,
The installation of Python-Ldap on Windows went well with the .whl package.
I also installed numpy-1.16.5 + mkl.
Installation using PIP.
Then I made bin / buildout, there error message that I join you.
Similarly I try despite this problem to launch the server plone with "Instance console".
I am also enclosing the error message.
Obviously python-ladap installs well but "breaks" the version of plone 5.1.5 installed.
Here is the feedback.
Does anyone have an idea to overcome this problem?
Thanks in advance.

Install Python-ldap >>>>> OK!

Microsoft Windows [version 10.0.14393]
(c) 2016 Microsoft Corporation. Tous droits réservés.

C:\Users\Administrateur>pip install E:\PythonLdap\python_ldap-3.2.0-cp27-cp27m-win_amd64.whl
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at Release process - pip documentation v24.0.dev0
Processing e:\pythonldap\python_ldap-3.2.0-cp27-cp27m-win_amd64.whl
Requirement already satisfied: pyasn1>=0.3.7 in c:\python27\lib\site-packages (from python-ldap==3.2.0) (0.4.7)
Collecting pyasn1-modules>=0.1.5 (from python-ldap==3.2.0)
Downloading https://files.pythonhosted.org/packages/52/50/bb4cefca37da63a0c52218ba2cb1b1c36110d84dcbae8aa48cd67c5e95c2/pyasn1_modules-0.2.7-py2.py3-none-any.whl (131kB)
|################################| 133kB 204kB/s
Installing collected packages: pyasn1-modules, python-ldap
Found existing installation: python-ldap 2.5.2
Uninstalling python-ldap-2.5.2:
Successfully uninstalled python-ldap-2.5.2
Successfully installed pyasn1-modules-0.2.7 python-ldap-3.2.0
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\Administrateur>

bin\buildout after python-ldap install

Microsoft Windows [version 10.0.14393]
(c) 2016 Microsoft Corporation. Tous droits réservés.

C:\Users\Administrateur>cd Plone

C:\Users\Administrateur\Plone>cd zinstance

C:\Users\Administrateur\Plone\zinstance>bin\buildout

C:\Users\Administrateur\Plone\zinstance>\Users\Administrateur\Plone\Python-2.7\Scripts\buildout.exe
Unused options for buildout: 'backups-dir'.
Installing instance.
Getting distribution for 'python-ldap>=3.2.0'.
no previously-included directories found matching 'Doc.build'
LDAPObject.c
c:\users\administrateur\appdata\local\temp\easy_install-e7idx8\python-ldap-3.2.0\modules\constants.h(7) : fatal error C1083: Cannot open include file: 'lber.h': No such file or directory
error: Setup script exited with error: command 'C:\Users\Administrateur\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2
An error occurred when trying to install c:\users\administrateur\plone\buildout-cache\downloads\dist\python-ldap-3.2.0.tar.gz. Look above this message for any errors that were output by easy_install.
While:
Installing instance.
Getting distribution for 'python-ldap>=3.2.0'.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "c:\users\administrateur\plone\python-2.7\lib\site-packages\zc\buildout\buildout.py", line 2128, in main
getattr(buildout, command)(args)
File "c:\users\administrateur\plone\python-2.7\lib\site-packages\zc\buildout\buildout.py", line 798, in install
installed_files = self[part].call(recipe.install)
File "c:\users\administrateur\plone\python-2.7\lib\site-packages\zc\buildout\buildout.py", line 1558, in call
return f()
File "c:\users\administrateur\plone\buildout-cache\eggs\plone.recipe.zope2instance-4.4.1-py2.7.egg\plone\recipe\zope2instance_init
.py", line 169, in install
installed.extend(self.install_scripts())
File "c:\users\administrateur\plone\buildout-cache\eggs\plone.recipe.zope2instance-4.4.1-py2.7.egg\plone\recipe\zope2instance_init
.py", line 668, in install_scripts
requirements, ws = self.egg.working_set(['plone.recipe.zope2instance'])
File "c:\users\administrateur\plone\buildout-cache\eggs\zc.recipe.egg-2.0.5-py2.7.egg\zc\recipe\egg\egg.py", line 84, in working_set
allow_hosts=self.allow_hosts,
File "c:\users\administrateur\plone\buildout-cache\eggs\zc.recipe.egg-2.0.5-py2.7.egg\zc\recipe\egg\egg.py", line 162, in _working_set
allow_hosts=allow_hosts)
File "c:\users\administrateur\plone\python-2.7\lib\site-packages\zc\buildout\easy_install.py", line 957, in install
return installer.install(specs, working_set)
File "c:\users\administrateur\plone\python-2.7\lib\site-packages\zc\buildout\easy_install.py", line 730, in install
for dist in self._get_dist(req, ws):
File "c:\users\administrateur\plone\python-2.7\lib\site-packages\zc\buildout\easy_install.py", line 574, in _get_dist
dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
File "c:\users\administrateur\plone\python-2.7\lib\site-packages\zc\buildout\easy_install.py", line 1740, in _move_to_eggs_dir_and_compile
[tmp_loc] = glob.glob(os.path.join(tmp_dest, '*'))
ValueError: need more than 0 values to unpack

C:\Users\Administrateur\Plone\zinstance>

<<<<<<<<<<<<
Microsoft Windows [version 10.0.14393]
(c) 2016 Microsoft Corporation. Tous droits réservés.

C:\Users\Administrateur>cd Plone

C:\Users\Administrateur\Plone>cd zinstance

C:\Users\Administrateur\Plone\zinstance>bin\instance console
Error: error opening file C:\Users\Administrateur\Plone\zinstance\parts\instance\etc\zope.conf: [Error 3] Le chemin dÆaccÞs spÚcifiÚ est introuvable: 'C:\Users\Administrateur\Plone\zinstance\parts\instance\etc\zope.conf'
For help, use C:\Users\Administrateur\Plone\zinstance\bin\instance-script.py -h

C:\Users\Administrateur\Plone\zinstance>

So, this looks like the wheel is not used and it tries to install again its own python-ldap. Probbaly solveable, but I dont have a Windows around to test it.

Last resort is using the WSL (Windows Linux Subsystem). This worked fine for my summer-intern.

Hello,
Thank you for your response and suggestions.
Since blocking does not seem major, do you have ideas that can point me to possible solutions?
If we can unblock the situation, it can be used by many others.
From experience feedback, it worked to the version 5.0.8
under Windows.
So we have a good chance of success with plone 5.1.5.
In addition, it may be that the order in which I installed the various programs and other packages can be problematic.
I will probably uninstall everything to reinstall more cleanly to see if it allows us to move forward.
Thanks again.

@adomy. I try to guess: you have installed pyton-ldap in default python location (ie c:\python2.7), but you are using a different python/virtualenv for Plone. Try to reinstall the python-ldap wheel with the pip program inside c:\users\administrateur\plone\python-2.7.
I hope that helps you to solve.

Hello,
Thank you for your help and your explanations.
As a matter of fact, as Dieter and Mauro have pointed out to me, ie
using pip installed in plone, python-ldap and its dependency are well installed under the python version of plone.
Then "pas.plugins.ldap" was installed without any problem to the server plone.
Thanks again.

mamico
Mauro Amico

    October 27

@adomy. I try to guess: you have installed pyton-ldap in default python location (ie c:\python2.7), but you are using a different python/virtualenv for Plone. Try to reinstall the python-ldap wheel with the pip program inside c:\users\administrateur\plone\python-2.7.
I hope that helps you to solve.