[Python] `.venv/lib` gets deleted just after creation on MacOS

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

  1. Stack

    Stack Membro Participativo

    I’ve been working on a project for a while but all of a sudden my .venv broke. Initially it created duplicates of a bunch of files inside .venv/lib, (e.g. file, file 2, file 3, ...), so I deleted the venv and decided to recreate it: uv venv .venv. Upon recreating it, it's fine for about a second, and then the whole .venv/lib directory gets deleted.

    I have no clue what could be causing this but its really frustrating, and I've explored a bunch of things:

    • It seems to be only happen in this project directory
    • If I call the venv any other name, it doesn't happen
    • It seems to happen whether or not Pycharm is active (my editor)
    • Also happens if I create the venv with python -m venv .venv

    It is also in my .gitignore. I've tried using some other directory watching tools but find the output too confusing/too precise the processes modifying it which seem to be mac-OS processes like fileproviderd. Any ideas of what it could be or other things I could try to track it down would be greatly appreciated!

    Continue reading...

Compartilhe esta Página