|
3 | 3 | Installation |
4 | 4 | ############ |
5 | 5 |
|
6 | | -The recommended way to install Python and desired packages (like OpenPNM) is using `uv <https://docs.astral.sh/uv>`_. `uv` has rapidly become the most popular package manager for Python. You'll be able to find lots of blog articles extolling the virtues of `uv`, but its main feature is speed. |
| 6 | +``uv`` |
| 7 | +------ |
7 | 8 |
|
8 | | -1. First you need to install `uv`. The official installation instructions are provided on the `astral website <https://docs.astral.sh/uv/getting-started/installation>`_. This will install `uv` on your system so it will be available from the terminal or command line. |
9 | | -2. Next you navigate to the folder where the project files and data will be or already are stored, like scripts and tomograms. |
10 | | -3. Then you create a virtual environment in that directory using `uv venv --python 3.12`. This adds a `.venv` folder, where `uv` will store all its information. Note that OpenPNM only supports python version 3.11, 3.12 and 3.13. This is largely because of dependencies which have firm version requirements. |
11 | | -4. Finally, you run `uv pip install openpnm`. The first time you do this `uv` will download and compile a few things, which may take some time, but it will store all of this so subsequent usage will be much faster. |
| 9 | +The recommended way to install Python and desired packages (like OpenPNM) is using `uv <https://docs.astral.sh/uv>`_. ``uv`` has rapidly become the most popular package manager for Python. You'll be able to find lots of blog articles extolling the virtues of ``uv``, but its main feature is speed. |
12 | 10 |
|
13 | | -When using `uv` we recommend `VSCode <https://code.visualstudio.com/>`_ as the IDE to write and edit scripts. VSCode will automatically find the `venv` inside the current folder, which is very handy. Spyder is a good IDE for scientific programming, but it does not (yet) have automatic support for finding `venvs` so is cumbersome to use when switching between projects. |
| 11 | +1. First you need to install ``uv``. The official installation instructions are provided on the `astral website <https://docs.astral.sh/uv/getting-started/installation>`_. This will install ``uv`` on your system so it will be available from the terminal or command line. |
| 12 | +2. Next you navigate to the folder where the project files and data will be or already are stored, like scripts and tomograms. |
| 13 | +3. Then you create a virtual environment in that directory using ``uv venv --python 3.12``. This adds a ``.venv`` folder, where ``uv`` will store all its information. Note that OpenPNM only supports python version 3.11, 3.12 and 3.13. This is largely because of dependencies which have firm version requirements. |
| 14 | +4. Finally, you run `uv pip install openpnm`. The first time you do this ``uv`` will download and compile a few things, which may take some time, but it will store all of this so subsequent usage will be much faster. |
14 | 15 |
|
15 | | -Installing the `dev` version |
16 | | -############################ |
| 16 | +When using ``uv`` we recommend `VSCode <https://code.visualstudio.com/>`_ as the IDE to write and edit scripts. VSCode will automatically find the ``venv`` inside the current folder, which is very handy. Spyder is a good IDE for scientific programming, but it does not (yet) have automatic support for finding ``venvs`` so is cumbersome to use when switching between projects. |
| 17 | + |
| 18 | +``conda`` |
| 19 | +--------- |
| 20 | + |
| 21 | +OpenPNM is also available via the `conda <https://docs.conda.io/en/latest/>`_ package manager. If you prefer to use ``conda``, you can install OpenPNM by running the following command in your terminal or command prompt: |
| 22 | + |
| 23 | +.. code-block:: bash |
| 24 | +
|
| 25 | + $ conda install conda-forge::openpnm |
| 26 | +
|
| 27 | +Installing the ``dev`` version |
| 28 | +############################## |
17 | 29 |
|
18 | 30 | If you are a OpenPNM contributor or want to get the newest updates as they roll in, you need to clone the OpenPNM repository from Github and install it locally. It's not as difficult as it sounds, just follow these steps: |
19 | 31 |
|
20 | 32 | Open up the terminal/cmd and use ``cd`` to navigate to the directory where you want to store the OpenPNM code. Clone the repo to your disk using: |
21 | 33 |
|
| 34 | +.. code-block:: bash |
| 35 | +
|
22 | 36 | $ git clone https://github.com/PMEAL/OpenPNM |
23 | 37 |
|
24 | 38 | Since your terminal is currently in the OpenPNM directory, you can now install OpenPNM and all its dependencies with: |
25 | 39 |
|
| 40 | +.. code-block:: bash |
| 41 | +
|
26 | 42 | $ uv pip install -e . |
27 | 43 |
|
28 | 44 | Voila! You can now use the latest features available on the ``dev`` branch. To keep your "local" OpenPNM installation up to date, you should regularly pull the latest changes: |
29 | 45 |
|
| 46 | +.. code-block:: bash |
| 47 | +
|
30 | 48 | $ git pull |
31 | 49 |
|
32 | 50 | .. warning:: |
|
0 commit comments