|
1 | 1 | # Installation
|
2 | 2 |
|
3 |
| -The documentation of MQT NAViz is still under construction. |
| 3 | +MQT NAViz is mainly developed as a Rust library with Python bindings. |
| 4 | +The resulting Python package is available on [PyPI](https://pypi.org/project/mqt.naviz/) and can be installed on all major operating systems using all modern Python versions. |
| 5 | + |
| 6 | +:::::{tip} |
| 7 | +We highly recommend using [`uv`](https://docs.astral.sh/uv/) for working with Python projects. |
| 8 | +It is an extremely fast Python package and project manager, written in Rust and developed by [Astral](https://astral.sh/) (the same team behind [`ruff`](https://docs.astral.sh/ruff/)). |
| 9 | +It can act as a drop-in replacement for `pip` and `virtualenv`, and provides a more modern and faster alternative to the traditional Python package management tools. |
| 10 | +It automatically handles the creation of virtual environments and the installation of packages, and is much faster than `pip`. |
| 11 | +Additionally, it can even set up Python for you if it is not installed yet. |
| 12 | + |
| 13 | +If you do not have `uv` installed yet, you can install it via: |
| 14 | + |
| 15 | +::::{tab-set} |
| 16 | + |
| 17 | +:::{tab-item} macOS and Linux |
| 18 | + |
| 19 | +```console |
| 20 | +$ curl -LsSf https://astral.sh/uv/install.sh | sh |
| 21 | +``` |
| 22 | + |
| 23 | +::: |
| 24 | + |
| 25 | +:::{tab-item} Windows |
| 26 | + |
| 27 | +```console |
| 28 | +$ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" |
| 29 | +``` |
| 30 | + |
| 31 | +::: |
| 32 | + |
| 33 | +:::: |
| 34 | + |
| 35 | +Check out their excellent [documentation](https://docs.astral.sh/uv/) for more information. |
| 36 | + |
| 37 | +::::: |
| 38 | + |
| 39 | +::::{tab-set} |
| 40 | +:sync-group: installer |
| 41 | + |
| 42 | +:::{tab-item} uv _(recommended)_ |
| 43 | +:sync: uv |
| 44 | + |
| 45 | +```console |
| 46 | +$ uv pip install mqt.naviz |
| 47 | +``` |
| 48 | + |
| 49 | +::: |
| 50 | + |
| 51 | +:::{tab-item} pip |
| 52 | +:sync: pip |
| 53 | + |
| 54 | +```console |
| 55 | +(.venv) $ python -m pip install mqt.naviz |
| 56 | +``` |
| 57 | + |
| 58 | +::: |
| 59 | + |
| 60 | +:::: |
| 61 | + |
| 62 | +In most practical cases (under 64-bit Linux, MacOS incl. Apple Silicon, and Windows), this requires no compilation and merely downloads and installs a platform-specific pre-built wheel. |
| 63 | + |
| 64 | +Once installed, you can check if the installation was successful by running: |
| 65 | + |
| 66 | +<!-- todo: adapt the following code --> |
| 67 | + |
| 68 | +```console |
| 69 | +(.venv) $ python -c "import mqt.naviz; print(mqt.naviz.__version__)" |
| 70 | +``` |
| 71 | + |
| 72 | +which should print the installed version of the library. |
| 73 | + |
| 74 | +## Building from source for performance |
| 75 | + |
| 76 | +For building MQT NAViz from the source, take a look at the {doc}`Development Guide <development_guide>`. |
| 77 | + |
| 78 | +## Integrating MQT NAViz into your project |
| 79 | + |
| 80 | +If you want to use the MQT Naviz Python package in your own project, you can simply add it as a dependency in your `pyproject.toml` or `setup.py` file. |
| 81 | +This will automatically install the MQT Naviz package when your project is installed. |
| 82 | + |
| 83 | +::::{tab-set} |
| 84 | + |
| 85 | +:::{tab-item} uv _(recommended)_ |
| 86 | + |
| 87 | +```console |
| 88 | +$ uv add mqt.naviz |
| 89 | +``` |
| 90 | + |
| 91 | +::: |
| 92 | + |
| 93 | +:::{tab-item} pyproject.toml |
| 94 | + |
| 95 | +```toml |
| 96 | +[project] |
| 97 | +# ... |
| 98 | +dependencies = ["mqt.naviz>=0.1.1"] |
| 99 | +# ... |
| 100 | +``` |
| 101 | + |
| 102 | +::: |
| 103 | + |
| 104 | +:::{tab-item} setup.py |
| 105 | + |
| 106 | +```python |
| 107 | +from setuptools import setup |
| 108 | + |
| 109 | +setup( |
| 110 | + # ... |
| 111 | + install_requires=["mqt.naviz>=0.1.1"], |
| 112 | + # ... |
| 113 | +) |
| 114 | +``` |
| 115 | + |
| 116 | +::: |
| 117 | + |
| 118 | +:::: |
0 commit comments