Cannot see the name of the current virtual environment in terminal

Viewed 152
  • I'm using Python 3 on Linux
  • When I open a new terminal, the name of virtual environment is not shown.
  • I can install python packages in this (unknown) environment with pip install
  1. What is the name of this current virtual environment ?
  2. How can I get the repository which this virtual environment uses to install packages (via pip) ?
1 Answers

When I open a new terminal, the name of virtual environment is not shown.

The name cannot be shown, because in order to see the name you must first activate the virtual environment. You have to

  1. create a virtual env in a folder
  2. cd into that folder
  3. run sh bin/activate

Then, the name will be shown.
Without an active virtual environment, pip will install the packages into

  • /usr/lib/python3 when run with admin rights (e.g. using sudo)
  • $HOME/.local/lib/python3 when run without admin rights

And the repository the packages will be downloaded from should normally be pypi.org.

Related