11.. _virtualenvironments-ref :
22
3+
4+ #############################
35Pipenv & Virtual Environments
4- =============================
6+ #############################
57
68.. image :: /_static/photos/35294660055_42c02b2316_k_d.jpg
79
@@ -18,9 +20,9 @@ managing development and testing environments for any kind of project.
1820.. Note :: This guide is written for Python 3, however, these instructions
1921 should work fine on Python 2.7—if you are still using it, for some reason.
2022
21-
23+ *********************************
2224Make sure you've got Python & pip
23- ---------------------------------
25+ *********************************
2426
2527Before you go any further, make sure you have Python and that it's available
2628from your command line. You can check this by simply running:
@@ -64,9 +66,9 @@ using your OS package manager, you may have to `install pip <https://pip.pypa.io
6466.. _Homebrew : https://brew.sh
6567.. _Installing Python : https://docs.python-guide.org/starting/installation/
6668
67-
69+ *****************
6870Installing Pipenv
69- -----------------
71+ *****************
7072
7173`Pipenv `_ is a dependency manager for Python projects. If you're familiar
7274with Node.js' `npm `_ or Ruby's `bundler `_, it is similar in spirit to those
@@ -109,8 +111,10 @@ Use ``pip`` to install Pipenv:
109111.. _modifying ~/.profile : https://stackoverflow.com/a/14638025
110112.. _Control Panel : https://msdn.microsoft.com/en-us/library/windows/desktop/bb776899(v=vs.85).aspx
111113
114+
115+ ************************************
112116Installing packages for your project
113- ------------------------------------
117+ ************************************
114118
115119Pipenv manages dependencies on a per-project basis. To install packages,
116120change into your project's directory (or just an empty directory for this
@@ -159,8 +163,9 @@ when you share your project with others. You should get output similar to this
159163 .. _Requests : https://python-requests.org
160164
161165
166+ ************************
162167Using installed packages
163- ------------------------
168+ ************************
164169
165170Now that Requests is installed you can create a simple ``main.py `` file to
166171use it:
@@ -190,8 +195,9 @@ your script. It's also possible to spawn a new shell that ensures all commands
190195have access to your installed packages with ``$ pipenv shell ``.
191196
192197
198+ **********
193199Next steps
194- ----------
200+ **********
195201
196202Congratulations, you now know how to install and use Python packages! ✨ 🍰 ✨
197203
@@ -219,7 +225,7 @@ Test your installation
219225 $ virtualenv --version
220226
221227 Basic Usage
222- ~~~~~~~~~~~
228+ -----------
223229
2242301. Create a virtual environment for a project:
225231
@@ -285,7 +291,7 @@ littered across your system, and its possible you'll forget their names or
285291where they were placed.
286292
287293Other Notes
288- ~~~~~~~~~~~
294+ -----------
289295
290296Running ``virtualenv `` with the option ``--no-site-packages `` will not
291297include the packages that are installed globally. This can be useful
@@ -318,8 +324,10 @@ control by adding it to the ignore list (see :ref:`Version Control Ignores<versi
318324
319325.. _virtualenvwrapper-ref :
320326
327+
328+ *****************
321329virtualenvwrapper
322- -----------------
330+ *****************
323331
324332`virtualenvwrapper <https://virtualenvwrapper.readthedocs.io/en/latest/index.html >`_
325333provides a set of commands which makes working with virtual environments much
@@ -346,7 +354,7 @@ To install (make sure **virtualenv** is already installed):
346354 In Windows, the default path for WORKON_HOME is %USERPROFILE%\E nvs
347355
348356Basic Usage
349- ~~~~~~~~~~~
357+ ===========
350358
3513591. Create a virtual environment:
352360
@@ -390,7 +398,7 @@ can quickly switch between environments.
390398 $ rmvirtualenv venv
391399
392400 Other useful commands
393- ~~~~~~~~~~~~~~~~~~~~~
401+ =====================
394402
395403``lsvirtualenv ``
396404 List all of the environments.
@@ -407,14 +415,17 @@ Other useful commands
407415
408416`Full list of virtualenvwrapper commands <https://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html >`_.
409417
418+
419+ ******************
410420virtualenv-burrito
411- ------------------
421+ ******************
412422
413423With `virtualenv-burrito <https://github.com/brainsik/virtualenv-burrito >`_, you
414424can have a working virtualenv + virtualenvwrapper environment in a single command.
415425
426+ *******
416427autoenv
417- -------
428+ *******
418429When you ``cd `` into a directory containing a :file: `.env `, `autoenv <https://github.com/kennethreitz/autoenv >`_
419430automagically activates the environment.
420431
0 commit comments