How

  1. install pip
  2. install virtualenv

     python3.11 -m pip install virtualenv
    
  3. mkdir for new project (e.g.,, ‘myproject’)

     mkdir myproject
     cd myproject
    
  4. create virtualenv (named ‘myproject’)

     virtualenv myproject
    
  5. activate virtualenv (‘myproject’)

     source ./bin/activate
    
  6. install stuff using pip, e.t.c.,

     python3.11 -m pip install ...
    
  7. All installed libraries are located at: ./lib/python***/site-packages

  8. deactivate virtualenv

     deactivate
    
  9. if you to delete the entire virtual environment

     sudo rm -rf myproject
    

Source

  • https://stackoverflow.com/questions/35017160/how-to-use-virtualenv-with-python