Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 6bb95e8

Browse files
Improved description for usage of virtual environment
1 parent e9bc187 commit 6bb95e8

1 file changed

Lines changed: 29 additions & 12 deletions

File tree

‎docs/README.md‎

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,33 @@ git config --local include.path ../.gitconfig
3434
Also make sure sqlite3 is available.
3535

3636
## Usage
37+
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+
3766

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.
39-
40-
#### For virtualenv
41-
[Installation](https://virtualenv.pypa.io/en/latest/userguide/) [Setup Guide](https://virtualenv.pypa.io/en/latest/userguide/)
42-
#### For virtualenvwrapper
43-
[Installation](https://virtualenvwrapper.readthedocs.io/en/latest/install.html) [Setup Guide](https://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html)
44-
#### For pyenv
45-
[Installation](https://github.com/pyenv/pyenv#installation) [Setup Guide](https://github.com/pyenv/pyenv#command-reference)
46-
#### For pipenv
47-
[Installation](https://pipenv.readthedocs.io/en/latest/#install-pipenv-today) [Setup Guide](https://pipenv.readthedocs.io/en/latest/#pipenv-usage)
48-
#### For anaconda
49-
[Installation](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) [Setup Guide](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)

0 commit comments

Comments
 (0)