DEV Community

Shaikh Al Amin
Shaikh Al Amin

Posted on • Updated on

Python3 venev setup in ubuntu

To install pip

sudo apt-get install -y python3.8-pip

Enter fullscreen mode Exit fullscreen mode

To install python3 virtual env

sudo apt install python3.8-venv

if required for python3.10
sudo apt install python3.10-venv
Enter fullscreen mode Exit fullscreen mode

To create a virtual env run the below command

python3.8 -m venv venv
Enter fullscreen mode Exit fullscreen mode

To activate virtual env run the below command

source venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

To deactivate just type deactivate

deactivate
Enter fullscreen mode Exit fullscreen mode

Deleting the Python Virtual Environment

rm -rf venv 
Enter fullscreen mode Exit fullscreen mode

To check the installed Python package inside the virtual env run the below command

pip list or pip3 list
Enter fullscreen mode Exit fullscreen mode

Top comments (0)