Professional Documents
Culture Documents
Virtual Environment Steps
Virtual Environment Steps
Creating a directory
• mkdir "Name of the directory"
• cd to the directory
• virtualenv project_name
To activate and deactivate the virtualenv on Windows
• Project_name\Scripts\activate.bat
• To deavtivate the virtualenv
• Project_name\Scripts\deactivate.bat
To activate and deactivate on Linux and Mac
• source project_name\bin\activate
• To activate only command deactivate
When you activate the virtualenv you loose the global installed packages
So you have to install them into the virtualenv one byone depending on your needs
If you want to export all the packages and the version numbers to use in another project
Pip freeze --local > requirements.txt
To read the file from the cmd prompt (Windows) type requirements.txt
To read the file from Mac or Linux cat requirements.txt
If you want to install the previous requirements from the txt file
pip install -r requirements.txt