python: import of psycopg2 breaks ldap
Hi there,
I’m trying to import psycopg2 and ldap python modules using AlpineLinux
(docker).
Maybe this is a psycopg2 or an ldap issue. But if I import psycopg2
before ldap it will crash. The other way around is ok.
Maybe a musl problem?
Python 2.7.14 (default, Dec 14 2017, 15:51:29)
[GCC 6.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>> import ldap
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/reviewboard/3.0.2/lib/python2.7/site-packages/ldap/__init__.py", line 20, in <module>
import _ldap
ImportError: Error relocating /opt/reviewboard/3.0.2/lib/python2.7/site-packages/_ldap.so: ber_free: symbol not found
>>>
Python 2.7.14 (default, Dec 14 2017, 15:51:29)
[GCC 6.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ldap
>>> import psycopg2
>>>
Both installed by “pip install”
python-ldap (2.5.2)
psycopg2 (2.7.3.2)
FYI: https://stackoverflow.com/questions/38740631/need-to-pre-import-module-to-avoid-error
Patching setup.cfg won’t fix the problem here.
Reported but closed:
https://github.com/psycopg/psycopg2/issues/667
(from redmine: issue id 8473, created on 2018-02-05)