Skip to content

Commit

Permalink
Merge pull request #763 from Yashesvinee/Python
Browse files Browse the repository at this point in the history
Python: 2.2 What is virtual environment?
  • Loading branch information
adityabisoi authored Sep 19, 2021
2 parents d0c808c + 1c94e00 commit 53c87be
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
- [What_Is_Programming_Language](./What_Is_Programming_Language)
- [What is type conversion ?](./Type_Conversion)
- [Use_Cases](./Use_Cases)
- [Virtual Environment](./Virtual_Environment)
- [Operators](./Operators)
## Learning path
1. Git & GitHub
2. Brief history of python
3. What is a programming language?
4. What is type conversion ?
5. Use cases of Python
6. Operators
6. Virtual Environment
7. Operators

46 changes: 45 additions & 1 deletion Python/Virtual_Environment/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
# Title (name of the topic)
<!--
1. Every major folder, for example, Frontend Web Development, Backend Web Development, Data Structures and Algorithm, etc, will have an index page.
2. Every index page should have a title, index with a link to all the language/topic folders, and a Learning path.
3. The learning path should act as a roadmap to the learners. The learners should not be clueless after coming to the repository.
-->





# Virtual environment
<!--
- [HTML](./html)
- [CSS](./css)
- [JavaScript](./javascript)
-->

# <a name="vir-envi"></a>

## What is it?
### A cooperatively isolated runtime environment that allows Python users and applications to install and upgrade Python distribution packages without interfering with the behaviour of other Python applications running on the same system.
----
## Python Virtual environment
### Python applications may often use packages and modules that don’t come as part of the standard library. This might require the installation of the packages and modules needed.
### On installation, the older versions of the packages/modules get deleted.In order to prevent this, a Virtual environment is created that contains a Python installation for a particular version of Python, plus a number of additional packages.
<img src="https://github.com/Yashesvinee/winter-of-contributing/blob/Python/Python/Virtual_Environment/img/venv.jpeg" width="400"><br>
----
## Creating a Virtual environment
### The module used to create and manage virtual environments is called *venv*. *venv* will usually install the most recent version of Python available. If you have multiple versions on your system, you can select a specific Python version by running the version you want.<br>To create a virtual environment, decide upon a directory where you want to place it, and run the venv module as a script with the directory path:
```
python3 -m venv project-env
```
### This creates the *project-env* directory if it doesn’t exist, along with the directories containing a copy of the Python interpreter, the standard library, and various supporting files. A common directory location for a virtual environment is *.venv*.<br><br>Once you’ve created a virtual environment, you may activate it.<br> On Windows:
```
project-env\Scripts\activate.bat
```
### On Unix/MacOS:
```
source project-env/bin/activate
```

---
### A virtual environment can be extremely useful when developing multiple projects that require different dependencies, developing across multiple computers, and making it easier to collaborate with others on projects.<br> There is no limit to the number of environments you can have since they’re just directories containing a few scripts.


Binary file added Python/Virtual_Environment/img/venv.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 53c87be

Please sign in to comment.