question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pipenv fails to install psycopg3

See original GitHub issue

Issue description

Trying to install the latest stable version of psycopg works with pip, but fails with pipenv.

Expected result

Running pipenv install psycopg[binary] should install the package.

Actual result

pipenv.exceptions.ResolutionFailure: ERROR: No matching distribution found for psycopg-binary==3.0.11 (from psycopg[binary]==3.0.11->-r /tmp/pipenv5ha8ujbbrequirements/pipenv-kwjgc03r-constraints.txt (line 3))

(See attached verbose logs: pipenv-stdout.txt )

Steps to replicate

pipenv install psycopg[binary]

in a freshly created pipenv environment.


$ pipenv --support

Pipenv version: '2021.5.29'

Pipenv location: '/usr/lib/python3.10/site-packages/pipenv'

Python location: '/usr/bin/python3'

Python installations found:

  • 3.10.4: /usr/bin/python3
  • 3.9.12: /usr/bin/python3.9
  • 2.7.18: /usr/bin/python2
  • 2.7.18: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.4',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.16.18-200.fc35.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP PREEMPT Mon Mar 28 14:10:07 UTC 2022',
 'python_full_version': '3.10.4',
 'python_version': '3.10',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • SESSION_MANAGER
  • COLORTERM
  • HISTCONTROL
  • XDG_MENU_PREFIX
  • HISTSIZE
  • HOSTNAME
  • SSH_AUTH_SOCK
  • XMODIFIERS
  • DESKTOP_SESSION
  • LC_MONETARY
  • LMOD_DIR
  • EDITOR
  • PWD
  • XDG_SESSION_DESKTOP
  • LOGNAME
  • XDG_SESSION_TYPE
  • MODULESHOME
  • MANPATH
  • SYSTEMD_EXEC_PID
  • XAUTHORITY
  • GDM_LANG
  • HOME
  • USERNAME
  • SSH_ASKPASS
  • LC_PAPER
  • LANG
  • LS_COLORS
  • XDG_CURRENT_DESKTOP
  • STARSHIP_SHELL
  • VTE_VERSION
  • WAYLAND_DISPLAY
  • LMOD_SETTARG_FULL_SUPPORT
  • GNOME_TERMINAL_SCREEN
  • LMOD_VERSION
  • STARSHIP_SESSION_KEY
  • MODULEPATH_ROOT
  • MOZ_GMP_PATH
  • GNOME_SETUP_DISPLAY
  • XDG_SESSION_CLASS
  • LMOD_PKG
  • TERM
  • LESSOPEN
  • USER
  • GNOME_TERMINAL_SERVICE
  • DISPLAY
  • LMOD_ROOT
  • SHLVL
  • BASH_ENV
  • LMOD_sys
  • QT_IM_MODULE
  • LC_MEASUREMENT
  • XDG_RUNTIME_DIR
  • DEBUGINFOD_URLS
  • LC_TIME
  • which_declare
  • XDG_DATA_DIRS
  • PATH
  • MODULEPATH
  • GDMSESSION
  • DBUS_SESSION_BUS_ADDRESS
  • LMOD_CMD
  • MAIL
  • LC_NUMERIC
  • OLDPWD
  • BASH_FUNC_ml%%
  • BASH_FUNC_which%%
  • BASH_FUNC_module%%
  • _
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/olojkine/.cargo/bin:/home/olojkine/.local/bin:/home/olojkine/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
  • SHELL: /bin/bash
  • EDITOR: /usr/bin/nano
  • LANG: en_US.UTF-8
  • PWD: /tmp/xxx

Contents of Pipfile (‘/tmp/xxx/Pipfile’):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
psycopg = {extras = ["binary"], version = "*"}

[dev-packages]

[requires]
python_version = "3.10"

An issue was opened in psycopg itself, but the maintainer insists the issue comes from pipenv: https://github.com/psycopg/psycopg/issues/113

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

2reactions
Polectroncommented, Apr 6, 2022

As the OP of the original issue I was also able to determine that the issue was fixable creating a manylinux2014 build of the package and created a PR containing a fix but the mantainer of psycopg rejected it.

1reaction
pschroeder89commented, Apr 15, 2022

Can you provide more details that might help one troubleshoot?

Sorry for the delay. The issue was that our internal artifact repo needed to be listed first in the Pipfile. Once we moved the PyPi source below the internal source, the issue was resolved for 2022.3.28

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv consistently failing to install pyscopg2 - Stack Overflow
I am on a Mac running OSX 10.14.4. Here is the output I get after running pipenv install : An error occurred while...
Read more >
Installation — Psycopg 2.9.5 documentation
This will install a pre-compiled binary version of the module which does not require the build or runtime prerequisites described below.
Read more >
pip install psycopg2 error subprocess-exited-with-error
So I think what is happening is that pip understands that and falls back to building psycopg from source, in which case the...
Read more >
gemnasium-python fails to install psycopg2-binary v2.9.2 with ...
When integrating Dependency Scanning into a Python project, the job will fail at installing psycopg2-binary 2.9.2 with pipenv.
Read more >
How To Install Psycopg2 In a Virtualenv - Spring Merchant
$ sudo apt-get install libpq-dev python-dev. If the installation fails, and you get a notice about certain packages not being found just run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found