You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 16, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 16, 2021. It is now read-only.
The importing fails. I think the following shell session contains all necessary details (glibc 2.26 was recently released, updating to this version triggers the problem):
$ uname -a
Linux ran 4.12.4-1-ARCH #1 SMP PREEMPT Fri Jul 28 18:54:18 UTC 2017 x86_64 GNU/Linux
$ pacman -Qi glibc | grep Version
Version : 2.26-1
$ python --version
Python 3.6.2
$ python -m venv venv
$ . venv/bin/activate
(venv) $ pip install psycopg2
Collecting psycopg2
Downloading psycopg2-2.7.3-cp36-cp36m-manylinux1_x86_64.whl (2.7MB)
100% |████████████████████████████████| 2.7MB 378kB/s
Installing collected packages: psycopg2
Successfully installed psycopg2-2.7.3
(venv) $ python
Python 3.6.2 (default, Jul 20 2017, 03:52:27)
[GCC 7.1.1 20170630] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "venv/lib/python3.6/site-packages/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: venv/lib/python3.6/site-packages/psycopg2/.libs/libresolv-2-c4c53def.5.so: symbol __res_maybe_init, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
Perhaps I should report this to the manylinux repository; if so please let me know.
In case it wasn't clear, installing from sdist works:
(venv) $ pip uninstall psycopg2
Successfully uninstalled psycopg2-2.7.3
(venv) $ pip install --no-binary :all: psycopg2
Collecting psycopg2
Downloading psycopg2-2.7.3.tar.gz (425kB)
100% |████████████████████████████████| 430kB 601kB/s
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... done
(venv) $ python
Python 3.4.6 (default, Aug 24 2017, 12:52:24)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>>
Reacted by Václav Ehrlich, Ivan, Simon Pascoe, Paul Pukach, iraj jelodari, Joao S. O. Bueno, Edward Nunez, Andrey Chikilev, Utkucan Bıyıklı, Leonardo Ramos Duarte and 61 more
Reacted by Nebil Aydi and Vivian Polli
Reacted by Sergey Tikhonov, Jure Erznožnik, Eric Jurio, Quang Huynh, Evgenii Kozhanov, Nebil Aydi, Pablo Gonzalez, Saicharan Reddy, Jennifer Paulino, Michael and 3 more
Reacted by Oswaldo Rodriguez, Juan de Monasterio, olivierlarge, Yash Dusing, Vivek Rajendran, Eric Jurio, L, Caleb Carvalho, Quang Huynh, Jeroen Rijks and 11 more
to the top of my requirements.txt to prevent pip from using the wheel. In fact, I prefer to use the system shared libraries over the bundled ones anyway, so I'll keep it regardless of the issue.
Thanks!
Reacted by Jeroen Rijks, EL HASSSANE GARGEM and Mateusz Marczak
pip install http://initd.org/psycopg/upload/psycopg2-2.7.3.1.dev0/psycopg2-2.7.3.1.dev0-cp36-cp36m-manylinux1_x86_64.whl should do.
Reacted by Jewel Lukose, Phillip Kigenyi, fuzzpedal, Alexander Clausen, Raham, Szczepan Zaskalski, msuari, robbieaverill, Darian Moody, neel_code and 4 more
Had the same issue and that dev from git hub worked!! Although, it only seemed to be a problem with running from a virtual environment. My image for docker ran fine. Go figure.
Activity
bluetech commentedon Aug 24, 2017
In case it wasn't clear, installing from sdist works:
dvarrazzo commentedon Aug 24, 2017
Sorry, I know it sounds silly but... "have you tried restarting it"?
I've seen old reports of this bug, e.g. https://lists.debian.org/debian-glibc/2005/08/msg00363.html that seem suggesting a runtime problem.
If not, yes please, report it to manylinux, because it seems suggesting an ABI change which is exactly what the guys tried to avoid.
bluetech commentedon Aug 24, 2017
I restarted the computer but it didn't help.
For now I added
to the top of my requirements.txt to prevent pip from using the wheel. In fact, I prefer to use the system shared libraries over the bundled ones anyway, so I'll keep it regardless of the issue.
Thanks!
Bump version number to try fixing libc 2.26 libresolv problem
Patch auditwheel to avoid including libresolv
Try building psycopg2 without issue #2
dvarrazzo commentedon Aug 25, 2017
Hello @bluetech
Could you please test if the wheel package at http://initd.org/psycopg/upload/psycopg2-2.7.3.1.dev0/ works ok? If so I'll push a patch to auditwheel. Thank you very much.
pip install http://initd.org/psycopg/upload/psycopg2-2.7.3.1.dev0/psycopg2-2.7.3.1.dev0-cp36-cp36m-manylinux1_x86_64.whlshould do.bluetech commentedon Aug 25, 2017
Yes, it fixes the problem. Specifically, the import works and the test suite of my project passes.
dvarrazzo commentedon Aug 25, 2017
Thank you very much for testing! I will release an updated wheel package.
upgraded psycopg2
[FIX] requirements: update psycopg2 version
snmpboy commentedon Nov 16, 2017
Had the same issue and that dev from git hub worked!! Although, it only seemed to be a problem with running from a virtual environment. My image for docker ran fine. Go figure.
3 remaining items
[FIX] make odoo 8.0 installable in ubuntu 18.04\n\nby upgrading psyco…
[FIX] make odoo 8.0 installable in ubuntu 18.04\n\nby upgrading psyco…
[FIX] requirements: update psycopg2 version
upgrade psycopg2 to work with glibc 2.28 (psycopg/psycopg2-wheels#2)
Bumped psycopg2 version in Pipfile to fix glibc problem.
Upgrade psycopg2 for psycopg/psycopg2-wheels#2
elliotvilhelm commentedon May 10, 2019
Had this issue and following @JoelAtDeluxe
pip install psycopg2 --upgradethrew the errorI followed
https://stackoverflow.com/questions/28253681/you-need-to-install-postgresql-server-dev-x-y-for-building-a-server-side-extensi
Then running
pip install psycopg2 --upgradesucceeds.Update psycopg2 to fix issue with the docker image
Update psycopg2 to fix issue with the docker image
Fix psycopg2 and libc interaction
Don't use binary psycopg2 because of psycopg/psycopg2-wheels#2
Fix Python libc segfault tied to psycopg2 installation
Fix Python libc segfault tied to psycopg2 installation (#567)
updated psycopg2 lib due to a bug with a certain version of glibc