psycopg2 warning with python3 #1564

Closed
opened 2025-12-29 16:33:00 +01:00 by adam · 2 comments
Owner

Originally created by @ryanmerolle on GitHub (Feb 20, 2018).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.2
  • psycopg2 version: 2.7.4
  • NetBox version: 2.2.9

BUG REPORT

  • many manage.py interaction result in a warning message
  • nothing fails, but just FYI to get ahead of the issue

Trigger

python3 /opt/netbox/netbox/manage.py migrate

Output

/usr/local/lib/python3.5/dist-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.

Originally created by @ryanmerolle on GitHub (Feb 20, 2018). ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [x] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> ### Environment * Python version: 3.5.2 * psycopg2 version: 2.7.4 * NetBox version: 2.2.9 ### BUG REPORT * many manage.py interaction result in a warning message * nothing fails, but just FYI to get ahead of the issue ### Trigger `python3 /opt/netbox/netbox/manage.py migrate` ### Output `/usr/local/lib/python3.5/dist-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.`
adam added the type: bugstatus: accepted labels 2025-12-29 16:33:00 +01:00
adam closed this issue 2025-12-29 16:33:00 +01:00
Author
Owner

@drybjed commented on GitHub (Feb 21, 2018):

The page linked by @ryanmerolle has this warning:

Warning The psycopg2 wheel package comes packaged, among the others, with its own libssl binary. This may create conflicts with other extension modules binding with libssl as well, for instance with the Python ssl module: in some cases, under concurrency, the interaction between the two libraries may result in a segfault. In case of doubts you are advised to use a package built from source.

There's also a solution to keep installing psycopg2 from source, preserving the current status. In requirements.txt, you can change the psycopg2 entry to:

psycopg2>=2.7,<2.8 --no-binary psycopg2

I think that would be a preferred solution to keep using system libraries instead of the bundled ones.

@drybjed commented on GitHub (Feb 21, 2018): The page linked by @ryanmerolle has this warning: > Warning The psycopg2 wheel package comes packaged, among the others, with its own libssl binary. This may create conflicts with other extension modules binding with libssl as well, for instance with the Python ssl module: in some cases, under concurrency, the interaction between the two libraries may result in a segfault. In case of doubts you are advised to use a package built from source. There's also a solution to keep installing `psycopg2` from source, preserving the current status. In `requirements.txt`, you can change the `psycopg2` entry to: ``` psycopg2>=2.7,<2.8 --no-binary psycopg2 ``` I think that would be a preferred solution to keep using system libraries instead of the bundled ones.
Author
Owner

@jeremystretch commented on GitHub (Feb 21, 2018):

I'm having a hard time figuring out what the recommended migration path is. Should we add psycopg2 to old_requirements.txt so that it gets uninstalled, and replace it with psycopg2-binary in requirements.txt?

@jeremystretch commented on GitHub (Feb 21, 2018): I'm having a hard time figuring out what the recommended migration path is. Should we add psycopg2 to `old_requirements.txt` so that it gets uninstalled, and replace it with psycopg2-binary in `requirements.txt`?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1564