You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 26, 2024. It is now read-only.
Repository navigation
Commit 6bb95e8
Browse filesBrowse the repository at this point in the historyBrowse files
A virtual environment is a tool that helps to keep dependencies required by different projects separate by creating isolated python virtual environments for them.
38
+
This means that each project can have its own dependencies, regardless of what dependencies every other project has.
39
+
We use a module named virtualenv which is a tool to create isolated Python environments.
40
+
virtualenv creates a folder which contains all the necessary executables to use the packages that a Python project would need.
41
+
42
+
Installing virtualenv:
43
+
44
+
$ pip install virtualenv
45
+
46
+
Test your installation:
47
+
48
+
$ virtualenv --version
49
+
50
+
Using virtualenv
51
+
52
+
You can create a virtualenv using the following command:
53
+
54
+
$ virtualenv my_name
55
+
56
+
After running this command, a directory named my_name will be created. This is the directory which contains all the necessary executables to use the packages that a Python project would need. This is where Python packages will be installed.
57
+
Now you can install dependencies related to the project in this virtual environment. For example if you are using Django 1.9 for a project, you can install it like you install other packages.
58
+
59
+
(virtualenv_name)$ pip install Django==1.9
60
+
Once you are done with the work, you can deactivate the virtual environment by the following command:
61
+
62
+
(virtualenv_name)$ deactivate
63
+
Now you will be back to system’s default Python installation.
64
+
65
+
37
66
38
-
It is recommended to set up virtual environment on your local machine, to seprate this project package from the package you have on your local machine.
0 commit comments