File: installing.rst

package info (click to toggle)
nanobind 2.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,060 kB
  • sloc: cpp: 11,838; python: 5,862; ansic: 4,820; makefile: 22; sh: 15
file content (48 lines) | stat: -rw-r--r-- 1,565 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.. _installing:

Installing the library
######################

The *nanobind* project is hosted at `wjakob/nanobind on GitHub
<https://github.com/wjakob/nanobind>`_. To use the library in your own
projects, it is usually easiest to install it using one of the following three
methods:

Install via Pip (recommended)
==============================

Run the following command in your terminal to install a package containing both
C++ and CMake source code needed to compile extension modules.

.. code-block:: bash

    python -m pip install nanobind

Install via Conda
=================

The following alternative installs an equivalent package through Conda. It is
provided for users that develop Conda-based extensions with a build-time
dependency on *nanobind*, in which case the PyPI package cannot be used.

.. code-block:: bash

    conda install -c conda-forge nanobind

Install as a Git submodule
==========================

If you prefer not to involve external package managers, and if your project
uses the Git control system, you may also directly reference *nanobind* as a
`Git submodule <https://git-scm.com/book/en/v2/Git-Tools-Submodules>`_. In the
main directory of your repository, run the following commands:

.. code-block:: bash

    git submodule add https://github.com/wjakob/nanobind ext/nanobind
    git submodule update --init --recursive

This assumes you are placing your dependencies in ``ext/``.

The :ref:`next section <building>` will explain how to set up a basic build
system that you can use to build your first extension module.