|
1 | 1 | Installing Pelican |
2 | 2 | ################## |
3 | 3 |
|
4 | | -Pelican currently runs best on |min_python|; earlier versions of Python are not supported. |
| 4 | +Pelican currently runs best on Python |min_python|; earlier versions of Python are not supported. |
5 | 5 |
|
6 | | -You can install Pelican via several different methods. The simplest is via Pip_:: |
| 6 | +Once Pelican is installed, you can run ``pelican --help`` to see basic usage |
| 7 | +options. For more detail, refer to the :doc:`Publish<publish>` section. |
| 8 | + |
| 9 | +You can install Pelican via several different methods. |
| 10 | + |
| 11 | +**Recommended method:** `Pip <https://pip.pypa.io/>`_ User Install |
| 12 | + |
| 13 | +To install Pelican via Pip:: |
| 14 | + |
| 15 | + python3 -m pip install --user "pelican[markdown]" |
| 16 | + |
| 17 | +Or, if you do not plan to use `Markdown <https://pypi.org/project/Markdown/>`_, |
| 18 | +you can omit the ``[markdown]`` suffix:: |
| 19 | + |
| 20 | + python3 -m pip install --user pelican |
| 21 | + |
| 22 | +**Alternate method 1:** `Pipx <https://github.com/pypa/pipx>`_ |
| 23 | + |
| 24 | +Pipx lets you execute binaries from Python packages in isolated environments. |
| 25 | +You can install Pipx by following its |
| 26 | +`documentation <https://pipx.pypa.io>`_. After Pipx is installed, |
| 27 | +you can install Pelican via:: |
| 28 | + |
| 29 | + pipx install "pelican[markdown]" |
7 | 30 |
|
8 | | - python -m pip install pelican |
| 31 | +**Alternate method 2:** `uv <https://docs.astral.sh/uv/>`_ |
9 | 32 |
|
10 | | -Or, if you plan on using Markdown:: |
| 33 | +Like Pipx, ``uv`` allows you to install tools in isolated environments. |
| 34 | +If you have ``uv`` installed, you can install Pelican via:: |
11 | 35 |
|
12 | | - python -m pip install "pelican[markdown]" |
| 36 | + uv tool install "pelican[markdown]" |
13 | 37 |
|
14 | | -(Keep in mind that some operating systems will require you to prefix the above |
15 | | -command with ``sudo`` in order to install Pelican system-wide.) |
| 38 | +**Alternate method 3:** Virtual Environment |
16 | 39 |
|
17 | | -While the above is the simplest method, the recommended approach is to create a |
18 | | -virtual environment for Pelican via virtualenv_ before installing Pelican. |
19 | | -Assuming you have virtualenv_ installed, you can then open a new terminal |
20 | | -session and create a new virtual environment for Pelican:: |
| 40 | +If you prefer to manually manage a virtual environment, you can create |
| 41 | +a virtual environment for Pelican via venv_ before installing Pelican:: |
21 | 42 |
|
22 | | - virtualenv ~/virtualenvs/pelican |
23 | | - cd ~/virtualenvs/pelican |
24 | | - source bin/activate |
| 43 | + python3 -m venv ~/virtualenvs/pelican |
| 44 | + source ~/virtualenvs/pelican/bin/activate |
| 45 | + python3 -m pip install "pelican[markdown]" |
25 | 46 |
|
26 | | -Once the virtual environment has been created and activated, Pelican can be |
27 | | -installed via ``python -m pip install pelican`` as noted above. Alternatively, if you |
28 | | -have the project source, you can install Pelican using the setuptools method:: |
| 47 | +Alternatively, if you have the project source, you can replace the last command |
| 48 | +with the following to install Pelican using the ``setuptools`` method:: |
29 | 49 |
|
30 | 50 | cd path-to-Pelican-source |
31 | | - python -m pip install . |
| 51 | + python3 -m pip install . |
32 | 52 |
|
33 | 53 | If you have Git installed and prefer to install the latest bleeding-edge |
34 | 54 | version of Pelican rather than a stable release, use the following command:: |
35 | 55 |
|
36 | | - python -m pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican" |
| 56 | + python3 -m pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican" |
37 | 57 |
|
38 | | -Once Pelican is installed, you can run ``pelican --help`` to see basic usage |
39 | | -options. For more detail, refer to the :doc:`Publish<publish>` section. |
| 58 | +To exit the virtual environment, type ``deactivate``. |
40 | 59 |
|
41 | 60 | Optional packages |
42 | 61 | ----------------- |
43 | 62 |
|
44 | 63 | If you plan on using `Markdown <https://pypi.org/project/Markdown/>`_ as a |
45 | 64 | markup format, you can install Pelican with Markdown support:: |
46 | 65 |
|
47 | | - python -m pip install "pelican[markdown]" |
| 66 | + python3 -m pip install --user "pelican[markdown]" |
48 | 67 |
|
49 | 68 | Typographical enhancements can be enabled in your settings file, but first the |
50 | | -requisite `Typogrify <https://pypi.org/project/typogrify/>`_ library must be |
| 69 | +requisite `Typogrify <https://github.com/justinmayer/typogrify>`_ library must be |
51 | 70 | installed:: |
52 | 71 |
|
53 | | - python -m pip install typogrify |
| 72 | + python3 -m pip install --user typogrify |
| 73 | + |
| 74 | +If you are using Pipx, you can inject packages into the Pipx-managed virtual |
| 75 | +environment. For example, to add Typogrify:: |
| 76 | + |
| 77 | + pipx inject pelican typogrify |
| 78 | + |
| 79 | +To use ``uv`` to install Pelican with additional extra packages, use the |
| 80 | +following example command, which like above will also install Typogrify:: |
| 81 | + |
| 82 | + uv tool install --with typogrify "pelican[markdown]" |
54 | 83 |
|
55 | 84 | Dependencies |
56 | 85 | ------------ |
@@ -80,11 +109,19 @@ Upgrading |
80 | 109 | If you installed a stable Pelican release via Pip_ and wish to upgrade to |
81 | 110 | the latest stable release, you can do so by adding ``--upgrade``:: |
82 | 111 |
|
83 | | - python -m pip install --upgrade pelican |
| 112 | + python3 -m pip install --upgrade pelican |
84 | 113 |
|
85 | | -If you installed Pelican via distutils or the bleeding-edge method, simply |
| 114 | +If you installed Pelican via ``setuptools`` or the bleeding-edge method, |
86 | 115 | perform the same step to install the most recent version. |
87 | 116 |
|
| 117 | +If you installed with Pipx, upgrade via:: |
| 118 | + |
| 119 | + pipx upgrade pelican |
| 120 | + |
| 121 | +If you installed with ``uv``, upgrade via:: |
| 122 | + |
| 123 | + uv tool upgrade pelican |
| 124 | + |
88 | 125 | Kickstart your site |
89 | 126 | ------------------- |
90 | 127 |
|
@@ -118,5 +155,5 @@ content):: |
118 | 155 | The next step is to begin to adding content to the *content* folder that has |
119 | 156 | been created for you. |
120 | 157 |
|
121 | | -.. _Pip: https://pip.pypa.io/ |
122 | 158 | .. _virtualenv: https://virtualenv.pypa.io/en/latest/ |
| 159 | +.. _venv: https://docs.python.org/3/library/venv.html |
0 commit comments