Issue
- 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
- What is the name of this current virtual environment ?
- How can I get the repository which this virtual environment uses to install packages (via pip) ?
Solution
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
- create a virtual env in a folder
- cd into that folder
- 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. usingsudo
)$HOME/.local/lib/python3
when run without admin rights
And the repository the packages will be downloaded from should normally be pypi.org.
Answered By - Programmer Answer Checked By - Senaida (WPSolving Volunteer)