Separate out virtual env
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by unknown · committed by unknown · parent a0e064b · Browse files · 3 files·+56 added−57 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+56 added−57 removed
- other:+56 added−57 removed
Provenance
- Commit
edb81f8- Tree
52462c4- Author
unknown <edward.g2013@gmail.com>- Committer
unknown <edward.g2013@gmail.com>- Parent
a0e064b
3 files changed+56 added−57 removed
modified:docs/index.rst+1 added
66 unmodified lines67 :maxdepth: 268 69 why70 quickstart71+ virtualenv72 setuptools73 parameters74 options75 arguments33 unmodified linesmodified:docs/quickstart.rst+4 added-57 removed
1 unmodified line2 ==========3 4 .. currentmodule:: click5 6-You can get the library directly from PyPI::6+Install 7+----------------------8+Install from PyPI::9 10 pip install click11 10-The installation into a :ref:`virtualenv` is heavily recommended.12+Installing into a virtual environment is highly recommended. We suggest :ref:`virtualenv-heading`. 13 12-.. _virtualenv:13-14-virtualenv15-----------16-17-Virtualenv is probably what you want to use for developing Click18-applications.19-20-What problem does virtualenv solve? Chances are that you want to use it21-for other projects besides your Click script. But the more projects you22-have, the more likely it is that you will be working with different23-versions of Python itself, or at least different versions of Python24-libraries. Let's face it: quite often libraries break backwards25-compatibility, and it's unlikely that any serious application will have26-zero dependencies. So what do you do if two or more of your projects have27-conflicting dependencies?28-29-Virtualenv to the rescue! Virtualenv enables multiple side-by-side30-installations of Python, one for each project. It doesn't actually31-install separate copies of Python, but it does provide a clever way to32-keep different project environments isolated.33-34-Create your project folder, then a virtualenv within it::35-36- $ mkdir myproject37- $ cd myproject38- $ python3 -m venv .venv39-40-Now, whenever you want to work on a project, you only have to activate the41-corresponding environment. On OS X and Linux, do the following::42-43- $ . .venv/bin/activate44- (venv) $45-46-If you are a Windows user, the following command is for you::47-48- > .venv\scripts\activate49- (venv) >50-51-Either way, you should now be using your virtualenv (notice how the prompt of52-your shell has changed to show the active environment).53-54-And if you want to stop using the virtualenv, use the following command::55-56- $ deactivate57-58-After doing this, the prompt of your shell should be as familiar as before.59-60-Now, let's move on. Enter the following command to get Click activated in your61-virtualenv::62-63- $ pip install click64-65-A few seconds later and you are good to go.66-14 Screencast and Examples15 -----------------------16 17 There is a screencast available which shows the basic API of Click and210 unmodified linesadded:docs/virtualenv.rst+51 added
1+.. _virtualenv-heading:2+3+Virtualenv4+========================= 5+6+Why use virtualenv?7+------------------------- 8+9+You should use `Virtualenv <https://virtualenv.pypa.io/en/latest/>`_ because: 10+11+* It allows you to install multiple versions of the same dependency.12+13+* If you have an operating system version of python, it prevents you from changing its dependencies and potentially messing up your os.14+15+How to use virtualenv 16+-----------------------------17+18+Create your project folder, then a virtualenv within it::19+20+ $ mkdir myproject21+ $ cd myproject22+ $ python3 -m venv .venv23+24+Now, whenever you want to work on a project, you only have to activate the25+corresponding environment. On OS X and Linux, do the following::26+27+ $ . .venv/bin/activate28+ (venv) $29+30+On Windows, do the following::31+32+ > .venv\scripts\activate33+ (venv) >34+35+You are now using your virtualenv (notice how the prompt of your shell has changed to show the active environment).36+37+To install in the virtual environment::38+39+ $ pip install click40+41+And if you want to stop using the virtualenv, use the following command::42+43+ $ deactivate44+45+After doing this, the prompt of your shell should be as familiar as before.46+ 47+48+49+50+51+