Skip to content

NameError: name 'pkg_resources' is not defined (Python ≥ 3.12) #394

@rymdbar

Description

@rymdbar

Attempting to pipx install vim-vint on a host with a contemporary python currently results in a program doing nothing more useful than spewing out a stack trace ending in:

ModuleNotFoundError: No module named 'pkg_resources'

Python 3.12's release notes seems to mention something about this under the subsection Important deprecations, removals or restrictions.

Issue #369 requesting a new release was filed almost five years ago, but essentially only met with an answer that the major release will not happen once all milestones have been accomplished. Fair enough.

There is a stable-0.3 branch, which unfortunately still has the issue. Starting with commit ad2fef9, the master branch appears to be working. That commit does depend on other changes, so it is not possible to cherry-pick for an easy win. I have not dived into actually attempting to understand what's going on, but from the surface it seems like adding some compatibility package might be enough to get the stable branch working with Python 3.12 and 3.13? Is the fix obvious for someone within the python eco-system. If so, could a 0.3.22 be released?

While not a solution, a possible workaround would seem to install vim-vint using an older python release. Before anyone tries that, beware that I made an attempt. Don't bother with pipx install --python 3.11 --fetch-missing-python vim-vint. It relies on fetching non-existing files and thus is broken. Installing vim-vint from this git repository, pipx install ., is the workaround which works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions