Skip to content
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

The 'psycopg2<2.8,>=2.7.4' distribution was not found #1036

Closed
Zebradil opened this issue Apr 9, 2019 · 6 comments
Closed

The 'psycopg2<2.8,>=2.7.4' distribution was not found #1036

Zebradil opened this issue Apr 9, 2019 · 6 comments

Comments

@Zebradil
Copy link

Zebradil commented Apr 9, 2019

Description

After update to pgcli 2.1.0-3 from AUR it doesn't start anymore giving the error:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (psycopg2 2.8.1 (/usr/lib/python3.7/site-packages), Requirement.parse('psycopg2<2.8,>=2.7.4'), {'pgcli'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pgcli", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3241, in <module>
    @_call_aside
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3225, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'psycopg2<2.8,>=2.7.4' distribution was not found and is required by pgcli

Your environment

I'm using Manjaro Linux,
pgcli is installed from AUR and have version 2.1.0-3,
psycopg version is 2.8.1

@Zebradil
Copy link
Author

Zebradil commented Apr 9, 2019

I understand that I can solve the problem by downgrading psycopg to earlier version. However, I'd like to know if it's possible to fix it in pgcli. Is it difficult? Can I help?

@Zebradil
Copy link
Author

Zebradil commented Apr 9, 2019

For those who need a fast solution, downgrade psycopg to the latest compatible version:

pip install --user -U psycopg2==2.7.7

@j-bennet
Copy link
Contributor

j-bennet commented Apr 9, 2019

That's right, pgcli was not updated or tested with pscopg2==2.8 yet. I understand this is annoying, but as a temporary workaround, you could install pgcli into a venv, and keep psycopg2==2.8 system-wide.

@Zebradil
Copy link
Author

Zebradil commented Apr 9, 2019

Personally for me it's not a problem or blocker (I've already downgraded it globally, because I use venvs for projects anyways). I just thought that it'd be nice for other users of pgcli to end up in this page and find the solution if they face the same issue.

@j-bennet
Copy link
Contributor

j-bennet commented Apr 9, 2019

@Zebradil Sure, you're welcome to submit a PR to upgrade pgcli to psycopg2>=2.8. You may want to look at some related issues that talk about binary vs source package:

#849
#974
#844

uqs pushed a commit to freebsd/freebsd-ports that referenced this issue May 28, 2019
pgcli depends on sqlparse<0.3.0,>=0.2.2, and sqlparse was updated to 0.3.0
in ports r495481.

pgcli depends on psycopg2>=2.7.4,<2.8, and psycopg2 was updated to 2.8.2
in ports r502646.

These broke run time, with the following error(s)

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'sqlparse<0.3.0,>=0.2.2' distribution was not found and is required by pgcli

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'psycopg2>=2.7.4,<2.8' distribution was not found and is required by pgcli

Upstream upgraded sqlparse support to include 0.3.0 in PR #1052 [1], this
change backports that PR accordingly.

Upstream has an open PR to unpin psycopg2 [2][3] but it needs to be updated
to use psycopg2 (not psycopg2-binary) in install_requires.

This change patches out the psycopg2 max version. The test results shows
no test failure delta with 2.8.2 over 2.7.7 (the version before ports
r502646).

While I'm here:

  - Declare pinned (maximum) RUN_DEPENDS versions according to setup.py
    to pick these issues up earlier during QA (max versions not being
    satisfied will error out during dependency builds/verification
    pre-commit

[1] dbcli/pgcli#1052
[2] dbcli/pgcli#1059
[3] dbcli/pgcli#1036

PR:		238182
Reported by:	Marcin Cieślak <saper saper info>
Approved by:	portmgr (blanket: run time fix, just fix it)


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@502867 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this issue May 28, 2019
pgcli depends on sqlparse<0.3.0,>=0.2.2, and sqlparse was updated to 0.3.0
in ports r495481.

pgcli depends on psycopg2>=2.7.4,<2.8, and psycopg2 was updated to 2.8.2
in ports r502646.

These broke run time, with the following error(s)

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'sqlparse<0.3.0,>=0.2.2' distribution was not found and is required by pgcli

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'psycopg2>=2.7.4,<2.8' distribution was not found and is required by pgcli

Upstream upgraded sqlparse support to include 0.3.0 in PR #1052 [1], this
change backports that PR accordingly.

Upstream has an open PR to unpin psycopg2 [2][3] but it needs to be updated
to use psycopg2 (not psycopg2-binary) in install_requires.

This change patches out the psycopg2 max version. The test results shows
no test failure delta with 2.8.2 over 2.7.7 (the version before ports
r502646).

While I'm here:

  - Declare pinned (maximum) RUN_DEPENDS versions according to setup.py
    to pick these issues up earlier during QA (max versions not being
    satisfied will error out during dependency builds/verification
    pre-commit

[1] dbcli/pgcli#1052
[2] dbcli/pgcli#1059
[3] dbcli/pgcli#1036

PR:		238182
Reported by:	Marcin Cieślak <saper saper info>
Approved by:	portmgr (blanket: run time fix, just fix it)
swills pushed a commit to swills/freebsd-ports that referenced this issue May 28, 2019
pgcli depends on sqlparse<0.3.0,>=0.2.2, and sqlparse was updated to 0.3.0
in ports r495481.

pgcli depends on psycopg2>=2.7.4,<2.8, and psycopg2 was updated to 2.8.2
in ports r502646.

These broke run time, with the following error(s)

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'sqlparse<0.3.0,>=0.2.2' distribution was not found and is required by pgcli

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'psycopg2>=2.7.4,<2.8' distribution was not found and is required by pgcli

Upstream upgraded sqlparse support to include 0.3.0 in PR #1052 [1], this
change backports that PR accordingly.

Upstream has an open PR to unpin psycopg2 [2][3] but it needs to be updated
to use psycopg2 (not psycopg2-binary) in install_requires.

This change patches out the psycopg2 max version. The test results shows
no test failure delta with 2.8.2 over 2.7.7 (the version before ports
r502646).

While I'm here:

  - Declare pinned (maximum) RUN_DEPENDS versions according to setup.py
    to pick these issues up earlier during QA (max versions not being
    satisfied will error out during dependency builds/verification
    pre-commit

[1] dbcli/pgcli#1052
[2] dbcli/pgcli#1059
[3] dbcli/pgcli#1036

PR:		238182
Reported by:	Marcin Cieślak <saper saper info>
Approved by:	portmgr (blanket: run time fix, just fix it)


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@502867 35697150-7ecd-e111-bb59-0022644237b5
Jehops pushed a commit to Jehops/freebsd-ports-legacy that referenced this issue May 28, 2019
pgcli depends on sqlparse<0.3.0,>=0.2.2, and sqlparse was updated to 0.3.0
in ports r495481.

pgcli depends on psycopg2>=2.7.4,<2.8, and psycopg2 was updated to 2.8.2
in ports r502646.

These broke run time, with the following error(s)

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'sqlparse<0.3.0,>=0.2.2' distribution was not found and is required by pgcli

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'psycopg2>=2.7.4,<2.8' distribution was not found and is required by pgcli

Upstream upgraded sqlparse support to include 0.3.0 in PR #1052 [1], this
change backports that PR accordingly.

Upstream has an open PR to unpin psycopg2 [2][3] but it needs to be updated
to use psycopg2 (not psycopg2-binary) in install_requires.

This change patches out the psycopg2 max version. The test results shows
no test failure delta with 2.8.2 over 2.7.7 (the version before ports
r502646).

While I'm here:

  - Declare pinned (maximum) RUN_DEPENDS versions according to setup.py
    to pick these issues up earlier during QA (max versions not being
    satisfied will error out during dependency builds/verification
    pre-commit

[1] dbcli/pgcli#1052
[2] dbcli/pgcli#1059
[3] dbcli/pgcli#1036

PR:		238182
Reported by:	Marcin Cieślak <saper saper info>
Approved by:	portmgr (blanket: run time fix, just fix it)


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@502867 35697150-7ecd-e111-bb59-0022644237b5
@dbaty
Copy link
Member

dbaty commented Sep 27, 2023

The latest release of pgcli (3.5.0) requires psycopg>=3.0.14, so this issue is moot. Shall we close it?

svmhdvn pushed a commit to svmhdvn/freebsd-ports that referenced this issue Jan 10, 2024
pgcli depends on sqlparse<0.3.0,>=0.2.2, and sqlparse was updated to 0.3.0
in ports r495481.

pgcli depends on psycopg2>=2.7.4,<2.8, and psycopg2 was updated to 2.8.2
in ports r502646.

These broke run time, with the following error(s)

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'sqlparse<0.3.0,>=0.2.2' distribution was not found and is required by pgcli

  raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'psycopg2>=2.7.4,<2.8' distribution was not found and is required by pgcli

Upstream upgraded sqlparse support to include 0.3.0 in PR #1052 [1], this
change backports that PR accordingly.

Upstream has an open PR to unpin psycopg2 [2][3] but it needs to be updated
to use psycopg2 (not psycopg2-binary) in install_requires.

This change patches out the psycopg2 max version. The test results shows
no test failure delta with 2.8.2 over 2.7.7 (the version before ports
r502646).

While I'm here:

  - Declare pinned (maximum) RUN_DEPENDS versions according to setup.py
    to pick these issues up earlier during QA (max versions not being
    satisfied will error out during dependency builds/verification
    pre-commit

[1] dbcli/pgcli#1052
[2] dbcli/pgcli#1059
[3] dbcli/pgcli#1036

PR:		238182
Reported by:	Marcin Cieślak <saper saper info>
Approved by:	portmgr (blanket: run time fix, just fix it)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants