|
6 | 6 | Install as PyPi package |
7 | 7 | ----------------------- |
8 | 8 |
|
| 9 | +Installing `cookiecutter-python` with `pip` is the way to go, for getting the |
| 10 | +`generate-python` cli onto your machine. Here we demonstrate how to do that using a |
| 11 | + |
9 | 12 |
|
10 | 13 | In virtual environment (recommended) |
11 | 14 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
12 | 15 |
|
13 | | -The recommended way of installing any python package, is use a *python virtual environment*. |
| 16 | +As with any Python Package, it is recommended to install *cookiecutter-python* inside a |
| 17 | +python *virtual environment*. You can use any of `virtualenv`, `venv`, `pyenv` of the |
| 18 | +tool of your choice. Here we demonstrate, using `virtualenv`, by running the following commands |
| 19 | +in a console (aka terminal): |
| 20 | + |
| 21 | +1. Create a virtual environment |
| 22 | + |
| 23 | + .. code-block:: shell |
| 24 | +
|
| 25 | + virtualenv env --python=python3 |
14 | 26 |
|
15 | 27 | Open a console (aka terminal) and run: |
16 | 28 |
|
17 | | -.. code-block:: shell |
| 29 | +2. Activate environment |
| 30 | + |
| 31 | + .. code-block:: shell |
| 32 | +
|
| 33 | + source env/bin/activate |
| 34 | +
|
| 35 | +3. Install `cookiecutter-python` |
| 36 | + |
| 37 | + .. code-block:: shell |
18 | 38 |
|
19 | | - virtualenv env --python=python3 |
20 | | - source env/bin/activate |
| 39 | + pip install cookiecutter-python |
21 | 40 |
|
22 | | - pip install cookiecutter-python |
| 41 | +4. Create symbolic link for the (current) user |
23 | 42 |
|
24 | | - deactivate |
| 43 | + .. code-block:: shell |
| 44 | +
|
| 45 | + ln -s env/bin/generate-python ~/.local/bin/generate-python |
25 | 46 |
|
26 | | - ln -s env/bin/generate-python ~/.local/bin/generate-python |
27 | 47 |
|
28 | 48 | Now the *generate-python* executable should be available (assuming ~/.local/bin is in your PATH)! |
29 | 49 |
|
30 | 50 |
|
31 | | -For user |
32 | | -^^^^^^^^ |
| 51 | +For user (option 2) |
| 52 | +^^^^^^^^^^^^^^^^^^^ |
33 | 53 |
|
34 | 54 | One could also opt for a *user* installation of *cookiecutter-python* package: |
35 | 55 |
|
36 | | -.. code-bloack: shell |
| 56 | +.. code-block:: shell |
37 | 57 |
|
38 | 58 | python3 -m pip install --user cookiecutter-python |
39 | 59 |
|
40 | 60 |
|
41 | | -For all users |
42 | | -^^^^^^^^^^^^^ |
| 61 | +For all users (option 3) |
| 62 | +^^^^^^^^^^^^^^^^^^^^^^^^ |
43 | 63 |
|
44 | 64 | The least recommended way of installing *cookiecutter-python* package is to |
45 | 65 | *directly* install in the *host* machine: |
46 | 66 |
|
47 | | -.. code-bloack: shell |
| 67 | +.. code-block:: shell |
48 | 68 |
|
49 | 69 | sudo python3 -m pip install cookiecutter-python |
50 | 70 |
|
51 | 71 | Note the need to invoke using *sudo*, hence not that much recommended. |
| 72 | + |
| 73 | + |
| 74 | +Check installation |
| 75 | +------------------ |
| 76 | + |
| 77 | +| Now the `generate-python` cli should be available! |
| 78 | +| You can verify by running the following: |
| 79 | +
|
| 80 | +.. code-block:: shell |
| 81 | +
|
| 82 | + generate-python --version |
0 commit comments