Skip to content

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

@vytas7

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions