Skip to content

Commit f65a2bf

Browse files
authored
Create virtual_environment_info.md
Fix for #116
1 parent 2dfd5bd commit f65a2bf

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

doc/virtual_environment_info.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Virtual Environment
2+
========================================
3+
4+
## What is a virtual environment?
5+
- A isolated Python environment that is installed into a directory.
6+
- Maintains it's own copy of Python and pip (Python's package manager).
7+
- When activated all Python operations will route to the Python interpreter within the virtual environment.
8+
9+
## What are the benefits?
10+
- Keeps your global site-packages directory clean and manageable.
11+
- Keeps system or user installed Python and it's libraries untouched.
12+
- Solves the problem of “Project X depends on version 1.x but, Project Y needs 4.x”.
13+
- Development will not interfere with the System or the user's python.
14+
- All libraries installed in the virtual environment will only be used within that environment.
15+
16+
## How to install?
17+
18+
$ pip install virtualenv
19+
20+
## How to create a virtual environment?
21+
In current directory:
22+
23+
python -m venv .
24+
25+
In a subdirectory that does not exist:
26+
27+
python -m venv ./new_dir
28+
29+
## How to activate a virtual environment?
30+
##### Windows
31+
```
32+
new_dir\scripts\activate.bat
33+
```
34+
##### MacOS/Linux (bash)
35+
```
36+
. new_dir/bin/activate
37+
```
38+
## How to deactivate a virtual environment?
39+
##### Windows
40+
```
41+
<clone_root>\env\scripts\deactivate.bat
42+
```
43+
##### MacOS/Linux (bash)
44+
```
45+
deactivate
46+
```

0 commit comments

Comments
 (0)