[Python] sys.prefix pointing to incorrect location, packages installing in incorrect locations

Discussão em 'Python' iniciado por Stack, Março 1, 2025.

  1. Stack

    Stack Membro Participativo

    After accidentally uninstalling python earlier this day I tried to reinstall it but sys.prefix got messed up and refused to fix itself.

    My sys.prefix is pointing to G:\ when it should be pointing to G:\Python.

    Additionally pip is being installed in G:\Scripts and my packages in G:\Lib, when they should be installed in G:\Python\Scripts or Lib. This causes none of my installed packages to work inside scripts.

    I have:

    • Changed PATH, PYTHONHOME, and PYTHONPATH to the correct location.
    • Created a pyvenv.cfg inside of my installation and set it correctly.
    • Reinstalled python and pip many times but things are still broken.
    • Looked up fixes on this site, yet none have worked.

    Continue reading...

Compartilhe esta Página