[Python] Virtual Environment calling global installation of Python instead of venv-specifc...

Discussão em 'Python' iniciado por Stack, Setembro 16, 2025.

  1. Stack

    Stack Membro Participativo

    I'm having an issue where for some reason the virtual environments that I'm creating are accessing my system-wide installations of Python and pip when they shouldn't be.

    Here's my fairly simple workflow just make sure I'm not missing anything obvious (Windows 10, Python 3.8.2):

    python -m venv venv
    venv\Scripts\activate.bat


    My path is now prepended by (venv), as you'd expect. However,

    pip list


    lists all of the system-wide pip packages I have instead of just the ones that should be in that venv.

    pyvenv.cfg indicates that

    include-system-site-packages = false


    When I open the interpreter using

    python


    In the virtual environment,

    sys.executable


    Returns the path on my C drive and

    print(pip.__file__)


    Does the same. I suspect they should instead be pointing to the interpreter and pip in the virtual environment but don't know how to make that happen.

    Edit: 4/27/20, Still dealing with this issue, I have tried:


    • uninstalling and reinstalling Python, both from python.org and the MS Store


    • Installing python in a new location


    • Clearing my user and system environment variables and then adding in just the ones for Python 3.8.

    I'm really at a loss here, would appreciate any help.

    Continue reading...

Compartilhe esta Página