Warning, /jana2/src/python/externals/pybind11-2.10.3/docs/installing.rst is written in an unsupported language. File is not indexed.
0001 .. _installing:
0002
0003 Installing the library
0004 ######################
0005
0006 There are several ways to get the pybind11 source, which lives at
0007 `pybind/pybind11 on GitHub <https://github.com/pybind/pybind11>`_. The pybind11
0008 developers recommend one of the first three ways listed here, submodule, PyPI,
0009 or conda-forge, for obtaining pybind11.
0010
0011 .. _include_as_a_submodule:
0012
0013 Include as a submodule
0014 ======================
0015
0016 When you are working on a project in Git, you can use the pybind11 repository
0017 as a submodule. From your git repository, use:
0018
0019 .. code-block:: bash
0020
0021 git submodule add -b stable ../../pybind/pybind11 extern/pybind11
0022 git submodule update --init
0023
0024 This assumes you are placing your dependencies in ``extern/``, and that you are
0025 using GitHub; if you are not using GitHub, use the full https or ssh URL
0026 instead of the relative URL ``../../pybind/pybind11`` above. Some other servers
0027 also require the ``.git`` extension (GitHub does not).
0028
0029 From here, you can now include ``extern/pybind11/include``, or you can use
0030 the various integration tools (see :ref:`compiling`) pybind11 provides directly
0031 from the local folder.
0032
0033 Include with PyPI
0034 =================
0035
0036 You can download the sources and CMake files as a Python package from PyPI
0037 using Pip. Just use:
0038
0039 .. code-block:: bash
0040
0041 pip install pybind11
0042
0043 This will provide pybind11 in a standard Python package format. If you want
0044 pybind11 available directly in your environment root, you can use:
0045
0046 .. code-block:: bash
0047
0048 pip install "pybind11[global]"
0049
0050 This is not recommended if you are installing with your system Python, as it
0051 will add files to ``/usr/local/include/pybind11`` and
0052 ``/usr/local/share/cmake/pybind11``, so unless that is what you want, it is
0053 recommended only for use in virtual environments or your ``pyproject.toml``
0054 file (see :ref:`compiling`).
0055
0056 Include with conda-forge
0057 ========================
0058
0059 You can use pybind11 with conda packaging via `conda-forge
0060 <https://github.com/conda-forge/pybind11-feedstock>`_:
0061
0062 .. code-block:: bash
0063
0064 conda install -c conda-forge pybind11
0065
0066
0067 Include with vcpkg
0068 ==================
0069 You can download and install pybind11 using the Microsoft `vcpkg
0070 <https://github.com/Microsoft/vcpkg/>`_ dependency manager:
0071
0072 .. code-block:: bash
0073
0074 git clone https://github.com/Microsoft/vcpkg.git
0075 cd vcpkg
0076 ./bootstrap-vcpkg.sh
0077 ./vcpkg integrate install
0078 vcpkg install pybind11
0079
0080 The pybind11 port in vcpkg is kept up to date by Microsoft team members and
0081 community contributors. If the version is out of date, please `create an issue
0082 or pull request <https://github.com/Microsoft/vcpkg/>`_ on the vcpkg
0083 repository.
0084
0085 Global install with brew
0086 ========================
0087
0088 The brew package manager (Homebrew on macOS, or Linuxbrew on Linux) has a
0089 `pybind11 package
0090 <https://github.com/Homebrew/homebrew-core/blob/master/Formula/pybind11.rb>`_.
0091 To install:
0092
0093 .. code-block:: bash
0094
0095 brew install pybind11
0096
0097 .. We should list Conan, and possibly a few other C++ package managers (hunter,
0098 .. perhaps). Conan has a very clean CMake integration that would be good to show.
0099
0100 Other options
0101 =============
0102
0103 Other locations you can find pybind11 are `listed here
0104 <https://repology.org/project/python:pybind11/versions>`_; these are maintained
0105 by various packagers and the community.