New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem loading psycopg2 with glibc 2.26 #2

Closed
bluetech opened this Issue Aug 24, 2017 · 9 comments

Comments

Projects
None yet
5 participants
@bluetech

bluetech commented Aug 24, 2017

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.

@bluetech

This comment has been minimized.

bluetech commented Aug 24, 2017

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
>>>
@dvarrazzo

This comment has been minimized.

Member

dvarrazzo commented 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

This comment has been minimized.

bluetech commented Aug 24, 2017

I restarted the computer but it didn't help.

For now I added

--no-binary psycopg2

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!

@bluetech bluetech closed this Aug 24, 2017

dvarrazzo added a commit to psycopg/psycopg2 that referenced this issue Aug 25, 2017

dvarrazzo added a commit that referenced this issue Aug 25, 2017

dvarrazzo added a commit that referenced this issue Aug 25, 2017

@dvarrazzo

This comment has been minimized.

Member

dvarrazzo commented 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.whl should do.

@dvarrazzo dvarrazzo reopened this Aug 25, 2017

@bluetech

This comment has been minimized.

bluetech commented Aug 25, 2017

Yes, it fixes the problem. Specifically, the import works and the test suite of my project passes.

@dvarrazzo

This comment has been minimized.

Member

dvarrazzo commented Aug 25, 2017

Thank you very much for testing! I will release an updated wheel package.

@dvarrazzo dvarrazzo closed this Aug 25, 2017

lsh-0 added a commit to elifesciences/lax that referenced this issue Sep 29, 2017

upgraded psycopg2
encountered this psycopg/psycopg2-wheels#2 after updating system

mart-e added a commit to odoo/odoo that referenced this issue Nov 13, 2017

[FIX] requirements: update psycopg2 version
2.7.1 is broken with glibc 2.66
upgrading to latest working version: 2.7.3
cf psycopg/psycopg2-wheels#2

Add CLA

Fixes #19511
Closes #19512
@snmpboy

This comment has been minimized.

snmpboy commented 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.

@JoelAtDeluxe

This comment has been minimized.

JoelAtDeluxe commented Nov 28, 2017

I had this issue, but doing pip install psycopg2 --upgrade fixed my issue

@yw-fang

This comment has been minimized.

yw-fang commented Feb 1, 2018

Just now I had this problem when launching a code in the Ubuntu 17.1 terminal. My solution was 'conda install psycopg2' to replace the old version.

jerojasro added a commit to vero4karu/desparchado that referenced this issue Apr 16, 2018

bigbear3001 pushed a commit to ap-wtioit/odoo that referenced this issue Jun 11, 2018

bigbear3001 pushed a commit to ap-wtioit/odoo that referenced this issue Jun 11, 2018

StephanRozendaal added a commit to neobis-it/odoo that referenced this issue Aug 13, 2018

[FIX] requirements: update psycopg2 version
2.7.1 is broken with glibc 2.66
upgrading to latest working version: 2.7.3
cf psycopg/psycopg2-wheels#2

Add CLA

Fixes odoo#19511
Closes odoo#19512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment