Skip to content

Commit

Permalink
Fix markdown syntax for venvs with modern triple-tick
Browse files Browse the repository at this point in the history
  • Loading branch information
avanwinkle committed Mar 21, 2024
1 parent 8c314f5 commit db4f816
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions docs/install/virtual-environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ To create a virtual enviroment, choose a folder where you want to install
a copy of Python and keep the enviroment's packages. For this example, we'll
call the environment "mpfenv" and put it in our home directory (known as "~").

.. code-block:: console
``` console
python3 -m venv ~/mpfenv
.. note::
```

!!! note
If you have multiple versions of Python3 (say, 3.9 and 3.11), you can specify
which one to use in the virtual environment: ``python3.9 -m venv ~/mpfenv``

Expand All @@ -44,34 +45,39 @@ To keep itself isolated from other programs, your virtual enviroment only
activates when you tell it to.
You can enable the virtual environment with the dot command from the terminal:

.. code-block:: console
``` console
. ~/mpfenv/bin/activate
```

Note that the first character is a period, followed by a space, then the path
to your virtual environment and "/bin/activate".

For users on Mac OSX, you will use `source` instead of the dot:
For users on Mac OSX, you will use `source` instead of the period:

.. code-block:: console
``` console
source ~/mpfenv/bin/activate
```

.. note::

!! note Make note of this activation command
You may want to write this step down, as you'll run it every time you open up
a terminal window to work on MPF
a terminal window to work on MPF. If you are on a dedicated MPF machine, you
could add this line to your bash/zsh profile to automatically run it at login.

You'll know you're in the virtual environment because the console prompt will include
the name of your venv in parenthesis.

.. code-block:: console
``` console
My-Mac:~ python --version
Python 2.7.10
My-Mac:~ source ~/mpfenv/bin/activate
(mpfenv) My-Mac:~ python --version
Python 3.9.13
(mpfenv) My-Mac:~
.. note::
```

!!! note
The python you used to create the virtual environment will now be the
default python. Outside the virtual environment "python" is Python 2 and
you must type "python3" to use Python 3; inside the virtual environment,
you can use "python" to refer to Python 3.
default python. Outside the virtual environment "python" may be Python 2 or 3, and
"python3" may be 3.6 or 3.9 or 3.11; inside the virtual environment,
you can use "python" to refer to the exact version of Python 3 you used
to create the virtual environment

0 comments on commit db4f816

Please sign in to comment.