Skip to content

pip 26.1.1 not functional in venv (no attribute sys.addaudithook) #7956

Closed

Description

@vytas7

Summary

If I create a rustpython venv, and then upgrade pip, it can no longer install anything.
It works itself to, e.g., print its version:

$ pip install -U pip
<...>
Successfully installed pip-26.1.1
$ pip -V
pip 26.1.1 from <tmp>/rustpython3.14t/site-packages/pip (python 3.14)

Note: I am running

Python 3.14.0.alpha (heads/master:f3b83efce, May 22 2026, 13:11:57)
[RustPython 0.5.0 with rustc 1.95.0 (59807616e 2026-04-14)]

Expected

I can pip install stuff.

Actual

I can no longer pip install stuff:

$ pip install falcon
Requirement already satisfied: falcon in ./rustvenv/lib/rustpython3.14t/site-packages (4.2.0)
ERROR: Exception:
Traceback (most recent call last):
  File "/tmp/rustvenv/lib/rustpython3.14t/site-packages/pip/_internal/cli/base_command.py", line 109, in _run_wrapper
    status = _inner_run()
  File "/tmp/rustvenv/lib/rustpython3.14t/site-packages/pip/_internal/cli/base_command.py", line 102, in _inner_run
    return self.run(options, args)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/tmp/rustvenv/lib/rustpython3.14t/site-packages/pip/_internal/cli/req_command.py", line 101, in wrapper
    return func(self, options, args)
  File "/tmp/rustvenv/lib/rustpython3.14t/site-packages/pip/_internal/commands/install.py", line 554, in run
    _prevent_further_imports()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/tmp/rustvenv/lib/rustpython3.14t/site-packages/pip/_internal/commands/install.py", line 131, in _prevent_further_imports
    sys.addaudithook(_prevent_import_hook)
    ^^^
AttributeError: module 'sys' has no attribute 'addaudithook'

Activity

  1. ShaharNaveh commented on May 23, 2026

    @ShaharNaveh
    Contributor

    Related to: #7860


    We do not support pip>=26.1.1 yet, and I'm not sure about how can we show a warning, to notify the users about this in the meantime until we have a fix

    cc: @youknowone

  2. vytas7 commented on May 23, 2026

    @vytas7
    Author

    Thanks for feedback @ShaharNaveh!

    On consideration, this issue could probably be distilled to an unsupported stdlib function, sys.addaudithook (added in CPython 3.8).

    $ rustpython -c "import sys; sys.addaudithook"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
        import sys; sys.addaudithook
                    ^^^
    AttributeError: module 'sys' has no attribute 'addaudithook'
    

    (This snippet passes on all other recent implementations, including PyPy and GraalPy.)

  3. changed the title [-]Upgraded `pip` not functional in venv (no attribute `'addaudithook'`)[/-] [+]Upgraded `pip` not functional in venv (no attribute `sys.addaudithook`)[/+] on May 23, 2026
  4. changed the title [-]Upgraded `pip` not functional in venv (no attribute `sys.addaudithook`)[/-] [+]`pip 26.1.1` not functional in venv (no attribute `sys.addaudithook`)[/+] on May 23, 2026
  5. jayvdb commented on Jun 16, 2026

    @jayvdb

    fwiw, pip 26.0.1 is the last release before that hook was added.
    Introduced in pip's commit pypa/pip@fb01b1830 on 2026-04-14, shipped in 26.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions