[Python] Renaming a virtualenv folder without breaking it

Discussão em 'Python' iniciado por Stack, Janeiro 22, 2025.

  1. Stack

    Stack Membro Participativo

    I've created folder and initialized a virtualenv instance in it.

    $ mkdir myproject
    $ cd myproject
    $ virtualenv env


    When I run (env)$ pip freeze, it shows the installed packages as it should.

    Now I want to rename myproject/ to project/.

    $ mv myproject/ project/


    However, now when I run

    $ . env/bin/activate
    (env)$ pip freeze


    it says pip is not installed. How do I rename the project folder without breaking the environment?

    Continue reading...

Compartilhe esta Página