Skip to content
Myr

docs use venv instead of virtualenv

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by darless · committed by David Lord · parent 8ee2f2e · Browse files · 2 files+10 added−29 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−29 removed

  • other:+10 added−29 removed

2 files+10 added−29 removed

modified:docs/quickstart.rst+8 added-27 removed
27 unmodified lines
2829Virtualenv to the rescue! Virtualenv enables multiple side-by-side30installations of Python, one for each project. It doesn't actually31install separate copies of Python, but it does provide a clever way to32keep different project environments isolated. Let's see how virtualenv33works.32keep different project environments isolated.3335If you are on Mac OS X or Linux::34Create your project folder, then a virtualenv within it::3537 $ pip install virtualenv --user3839One of these will probably install virtualenv on your system. Maybe it's even40in your package manager. If you use Ubuntu, try::4142 $ sudo apt-get install python-virtualenv4344If you are on Windows (or none of the above methods worked) you must install45``pip`` first. For more information about this, see `installing pip`_.46Once you have it installed, run the ``pip`` command from above, but without47the `sudo` prefix.4849.. _installing pip: https://pip.readthedocs.io/en/latest/installing/5051Once you have virtualenv installed, just fire up a shell and create52your own environment. I usually create a project folder and a `venv`53folder within::5436 $ mkdir myproject37 $ cd myproject57 $ virtualenv venv58 New python executable in venv/bin/python59 Installing setuptools, pip............done.38 $ python3 -m venv .venv3940Now, whenever you want to work on a project, you only have to activate the41corresponding environment. On OS X and Linux, do the following::4264 $ . venv/bin/activate43 $ . .venv/bin/activate44 (venv) $4546If you are a Windows user, the following command is for you::4768 $ venv\scripts\activate48 > .venv\scripts\activate49 (venv) >5051Either way, you should now be using your virtualenv (notice how the prompt of52your shell has changed to show the active environment).5373And if you want to go back to the real world, use the following command::54And if you want to stop using the virtualenv, use the following command::5556 $ deactivate5758After doing this, the prompt of your shell should be as familiar as before.
222 unmodified lines
modified:docs/setuptools.rst+2 added-2 removed
95 unmodified lines
96package:9798.. code-block:: console99100 $ virtualenv venv101 $ . venv/bin/activate100 $ python3 -m venv .venv101 $ . .venv/bin/activate102 $ pip install --editable .103104Afterwards, your command should be available:105
48 unmodified lines