├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Abhishek Rajput 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python Virtual Environment Setup 2 | 3 | This guide provides step-by-step instructions to create and activate a Python virtual environment using `virtualenv`. 4 | 5 | ## Prerequisites 6 | 7 | - Ensure Python 3 is installed on your system. You can download it from the [official Python website](https://www.python.org/downloads/). 8 | - Ensure `pip` is installed. `pip` typically comes with Python, but you can install it separately if needed. 9 | 10 | ## Steps to Create a Virtual Environment 11 | 12 | 1. **Install `virtualenv`**: 13 | ```bash 14 | pip install virtualenv 15 | ``` 16 | 17 | 2. **Create a Virtual Environment**: 18 | ```bash 19 | virtualenv -p python3 env 20 | ``` 21 | This command creates a virtual environment named `env` using Python 3. 22 | 23 | 3. **Activate the Virtual Environment**: 24 | 25 | - **For Linux/MacOS**: 26 | ```bash 27 | source env/bin/activate 28 | ``` 29 | - **For Windows**: 30 | ```bash 31 | env\Scripts\activate 32 | ``` 33 | 34 | ## Deactivating the Virtual Environment 35 | 36 | To deactivate the virtual environment, simply run: 37 | ```bash 38 | deactivate 39 | ``` 40 | 41 | ## Additional Information 42 | 43 | - **Installing Packages**: Once the virtual environment is activated, you can install packages using `pip` as usual, e.g., 44 | 45 | ```bash 46 | pip install package_name 47 | ``` 48 | - **Freezing Requirements**: To freeze the installed packages into a `requirements.txt` file, use: 49 | ```bash 50 | pip freeze > requirements.txt 51 | ``` 52 | - **Installing from `requirements.txt`**: To install packages from a `requirements.txt` file, use: 53 | ```bash 54 | pip install -r requirements.txt 55 | ``` 56 | 57 | ## Author 58 | 59 | Abhishek Rajput
60 | Palak Rajput 61 | --------------------------------------------------------------------------------