Skip to content

venv can't figure out that it's isolated #127025

@fedd20

Description

@fedd20

Bug report

Bug description:

I installed python3.13 on my Macbook Pro M1 using Homebrew.

I create venv, activate it and trying to install package. But I'm getting this error:
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

I figured out that I can force pip to think that it's isolated. I just added following line in venv/bin/pip3:

#...
if __name__ == '__main__':
    sys.argv.append("--isolated") # i added this line

It worked.

I don't know exactly where is problem: in pip or in venv. But in latest pip version there is the same error, so maybe it's not pip, idk. Or maybe I did something wrong, or maybe homebrew package is broken, idk.

As I remember, in python3.12 that I also installed using Homebrew there was no such error, everything worked out of box perfectly.

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-venvRelated to the venv moduletype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions