Posts

Showing posts from August, 2020

How to install Virtual environment (virtualenv) and requirements.txt in python3

Image
Install virtual environment and use requirements.txt Step 1. Install python 3 sudo apt-get update sudo apt-get install python3.6 you can check python version python3 -V Step 2 Now install  sudo apt install python3-pip Please check pip version pip3 -V   it's should be >= pip 20.0.0 Step 3 Install virtualenv pip3 install virtualenv Step 4 Now select a directory where you want to setup virtualenv Like cd /directory/path Step 5 In that directory setup virtualenv with python3 virtualenv -p python3 ./dir_name it will create a dir_name folder (dir), You can change it whatever you like (dir_name you should write anything whatever you like) Step 6 Now active it  source dir_name/bin/activate now you console look like this (dir_name) computer$ if you write down "python" and  then enter, your python3 will be run  Step 7 pip3 install install-requires Now we have 2 ways to create requirements.txt (i) install any packages pip3 inst