Sunday, March 31, 2019

Re: pip install (python3) requires some development libraries

[CC-ing Remi, "python2.7" package maintainer]
[Stuart, already CC-ed, is maintainer of the "openldap-client" package]

The subject line of this email says "python3", but the same issue occurs
with python2.7 (this on OpenBSD 6.4).

I filed an report for the broken `pip install python-ldap` issue (technically a
`python setup.py build` issue) on GitHub here:

https://github.com/python-ldap/python-ldap/issues/273 <https://github.com/python-ldap/python-ldap/issues/273>

They claim it's an OpenBSD's issue:

It's either a problem with OpenBSD, compiler settings, OpenBSD's
package manager, or Python on OpenBSD. The build system should
pick up default locations for headers and libraries.

/usr/local/include/lber.h comes from the "openldap-client" package but, as
the report below shows, the `cc` flags are passing "/usr/local/include/python*",
where '*' in "2.7" in my case and "3.6m" below.

So who's right? Is this a "python-ldap" package issue or an OpenBSD issue?

FWIW, I am able to install python-ldap using Stuart's instructions below, but
doing so is inconvenient when the dependency comes when trying to `pip
install` an even higher-level Python package.

Thanks,
Kent



> On Aug 27, 2018, at 9:09 AM, Stuart Henderson <stu@spacehopper.org> wrote:
>
> On 2018/08/27 15:43, Максим wrote:
>> I manually downloaded the python-ldap-3.1.0.tar.gz archive (this packet is a dependency
>> which gives that error).
>>
>> unpacked it and ran python setup.py build.
>> The same error:
>> "running build
>> running build_py
>> 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'
>> running build_ext
>> building '_ldap' extension
>> cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG
>> -O2 -pipe -fPIC -O2 -pipe -O2 -pipe -fPIC -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 -I/home/misa/REQUEST_TRACKER/rt/include
>> -I/usr/local/include/python3.6m -c Modules/LDAPObject.c
>> -o build/temp.openbsd-6.4-amd64-3.6/Modules/
>> LDAPObject.o
>> In file included from Modules/LDAPObject.c:8:
>> Modules/constants.h:7:10: fatal error: 'lber.h' file not found
>> #include "lber.h"
>> ^~~~~~~~
>> 1 error generated.
>> error: command 'cc' failed with exit status 1
>>
>> As already noticed THERE IS a file lber.h on my system.
>> The thing is it is no seen by the installer
>>
>> I run pip3 inside a virtualenv.
>> Without using a venv I have the same result
>
> For python-ldap 3.1.0 you will need to add the following to setup.cfg in
> the [_ldap] section.
>
> library_dirs = /usr/local/lib
> include_dirs = /usr/local/include /usr/local/include/sasl
>
>

No comments:

Post a Comment