Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#52994 closed defect (fixed)

flake8 fails to run with pkg_resources.DistributionNotFound

Reported by: rectalogic (Andrew Wason) Owned by: petrrr
Priority: Normal Milestone:
Component: ports Version: 2.3.5
Keywords: Cc:
Port: py-flake8

Description

py-flake8 3.2.1 port fails to run:

$ flake8
Traceback (most recent call last):
  File "/opt/local/bin/flake8", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3017, in <module>
    @_call_aside
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3030, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 659, in _build_master
    ws.require(__requires__)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 967, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 853, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'configparser' distribution was not found and is required by flake8

port install py-configparser fixes that but results in:

$ flake8
Traceback (most recent call last):
  File "/opt/local/bin/flake8", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3017, in <module>
    @_call_aside
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3030, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 659, in _build_master
    ws.require(__requires__)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 967, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 853, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'enum34' distribution was not found and is required by flake8

port install py-enum34 fixes that.

Change History (3)

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Owner: set to petrrr
Status: newassigned

In the future, please Cc the port maintainers (port info --maintainers py-flake8), if any.

comment:2 Changed 8 years ago by petrrr

Resolution: fixed
Status: assignedclosed

In 03b02e5/macports-ports:

py-flake8: add dependencies for Python 2.7

The two dependencies are required only for the py27 subport and
available in the standard library otherwise.

  • configparser renamed in Python 3
  • enum since Python 3.4

Fixes: #52994

comment:3 Changed 8 years ago by petrrr

Such things get occasionally unobserved because the respective packages are already installed through other python packages.

Thanks for reporting!

Note: See TracTickets for help on using tickets.