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

AttributeError: 'zipimporter' object has no attribute 'find_module'. Did you mean: 'load_module'? #11793

Closed
1 task done
thedtvn opened this issue Feb 11, 2023 · 5 comments
Closed
1 task done
Labels
resolution: duplicate Duplicate of an existing issue/PR

Comments

@thedtvn
Copy link

thedtvn commented Feb 11, 2023

Description

AttributeError: 'zipimporter' object has no attribute 'find_module'. Did you mean: 'load_module'?

Expected behavior

juse run pip list and print all pack

pip version

can not get

Python version

Python 3.12.0a4

OS

linux

How to Reproduce

sudo apt install python3.12* && sudo apt install libpython1.12*
then wait
and run
python3.12 -m pip list

Output

python3.12 -m pip -V
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/lib/python3/dist-packages/pip/main.py", line 16, in
from pip._internal.cli.main import main as _main # isort:skip # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in
from pip._internal.cli.autocompletion import autocomplete
File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in
from pip._internal.cli.main_parser import create_main_parser
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in
from pip._internal.cli import cmdoptions
File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 24, in
from pip._internal.exceptions import CommandError
File "/usr/lib/python3/dist-packages/pip/_internal/exceptions.py", line 10, in
from pip._vendor.six import iteritems
File "/usr/lib/python3/dist-packages/pip/_vendor/init.py", line 79, in
vendored("pkg_resources")
File "/usr/lib/python3/dist-packages/pip/_vendor/init.py", line 36, in vendored
import(modulename, globals(), locals(), level=0)
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py", line 3251, in
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py", line 3235, in _call_aside
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py", line 3277, in _initialize_master_working_set
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py", line 3278, in
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py", line 2785, in activate
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py", line 2284, in declare_namespace
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/init.py", line 2201, in _handle_ns
AttributeError: 'zipimporter' object has no attribute 'find_module'. Did you mean: 'load_module'?

Code of Conduct

@thedtvn thedtvn added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Feb 11, 2023
@RonnyPfannschmidt
Copy link
Contributor

Looks like a upstream issue in the distro with devendoring

@pfmoore
Copy link
Member

pfmoore commented Feb 11, 2023

No, it's a Python 3.12 issue - from What's New in 3.12:

zipimport: Remove find_loader() and find_module() methods, deprecated in Python 3.10: use the find_spec() method instead. See PEP 451 for the rationale. (Contributed by Victor Stinner in gh-94379.)

It looks like this is something that might need to be fixed in the vendored pkg_resources module.

@pfmoore
Copy link
Member

pfmoore commented Feb 11, 2023

However, see the comment here - the intention is that we stop using pkg_resources at all in Python 3.12. This issue might simply mean we need to prioritise making that happen.

@pradyunsg
Copy link
Member

I’m pretty sure that this isn’t us but whomever is modifying pip. Based on the use of apt, this looks like a Debian derived distribution like Ubuntu and, it’s likely with the deadsnakes ppa. Regardless of the details, I am gonna say this isn’t a pip issue but an issue with whomever is modifying pip that you’re fetching via apt.

#11794 is where we’ll start testing against 3.12 within pip.

@uranusjr
Copy link
Member

I think this one can be closed? The 3.12 issue is already tracked elsewhere, and I don’t think there are other actionable items here.

@uranusjr uranusjr closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2023
@uranusjr uranusjr added resolution: duplicate Duplicate of an existing issue/PR and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Feb 12, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: duplicate Duplicate of an existing issue/PR
Projects
None yet
Development

No branches or pull requests

5 participants