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

Pip crash in python3.12 #106824

Closed
ghost opened this issue Jul 17, 2023 · 4 comments
Closed

Pip crash in python3.12 #106824

ghost opened this issue Jul 17, 2023 · 4 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@ghost
Copy link

ghost commented Jul 17, 2023

So, pip was just working a moment ago and I did python3.12 -m pip install colorama and it worked. Now, when I did pip install bcrypt its failing. Now, even python3.12 -m pip freeze is failing.

Bug report

python3.12 -m pip freeze
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pip/_internal/commands/freeze.py", line 87, in run
    for line in freeze(
  File "/usr/local/lib/python3.12/site-packages/pip/_internal/operations/freeze.py", line 42, in freeze
    for dist in dists:
  File "/usr/local/lib/python3.12/site-packages/pip/_internal/metadata/base.py", line 664, in <genexpr>
    return (d for d in it if d.canonical_name not in skip)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pip/_internal/metadata/base.py", line 612, in iter_all_distributions
    for dist in self._iter_distributions():
  File "/usr/local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 178, in _iter_distributions
    yield dist
  File "/usr/local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 144, in find_eggs
    yield from self._find_eggs_in_dir(location)
  File "/usr/local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py", line 111, in _find_eggs_in_dir
    from pip._vendor.pkg_resources import find_distributions
  File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3251, in <module>
    @_call_aside
     ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3277, in _initialize_master_working_set
    tuple(
  File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3278, in <genexpr>
    dist.activate(replace=False)
  File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2785, in activate
    declare_namespace(pkg)
  File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2284, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2201, in _handle_ns
    loader = importer.find_module(packageName)
             ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'zipimporter' object has no attribute 'find_module'. Did you mean: 'load_module'?

Your environment

  • CPython versions tested on: Python 3.12.0a3+ (Python 3.12.0a3+ (heads/main:f10f503b24, Dec 29 2022, 10:45:07) [GCC 12.2.0] on linux)
  • Operating system and architecture: Linux kali-linux 6.1.0-kali9-amd64 Support "bpo-" in Misc/NEWS #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1kali1 (2023-05-12) x86_64 GNU/Linux
@ghost ghost added the type-bug An unexpected behavior, bug, or error label Jul 17, 2023
@ghost
Copy link
Author

ghost commented Jul 17, 2023

This problem is in my home PC. As a side note, I have faced this problem in VPS as well which has debian. So I guess this issue applies to debain distro and more. I dont know whats the trigger. Actually I ran two commands. python3.12 -m pip install colorama and python3.12 -m pip install mysql-connector-python. This error appeared at python3.12 -m pip install bcrypt. Here's my command line history
image

@AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jul 17, 2023
@ghost
Copy link
Author

ghost commented Jul 17, 2023

How to fix pip freeze and pip install not working though. It was working before. Couldnt find a solution in those duplicates @AlexWaygood

@AlexWaygood
Copy link
Member

You'll need to ask the pip maintainers that question. This is the CPython issue tracker, not the pip issue tracker, and I'm not a pip maintainer. If you've read through the above issues and still haven't found an answer to your question, my advice is to ask it at pypa/pip#11501.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant