summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2023-10-13 22:28:22 +0200
committerMatthias Geier <Matthias.Geier@gmail.com>2023-10-13 22:28:22 +0200
commita48a52c67253d564e8e8621a46733b2e1037be32 (patch)
treeac934517d9648da9b1dd3185fcc9837fee4c4c87 /doc
parent4aa98dca11faf2a49852cc3e0051cfc1970abaa3 (diff)
DOC: Update installation docs
Diffstat (limited to 'doc')
-rw-r--r--doc/conf.py1
-rw-r--r--doc/installation.rst100
2 files changed, 49 insertions, 52 deletions
diff --git a/doc/conf.py b/doc/conf.py
index 0c35fe9..b07438b 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -56,6 +56,7 @@ except Exception:
today = '<unknown date>'
default_role = 'any'
+highlight_language = 'none'
nitpicky = True
diff --git a/doc/installation.rst b/doc/installation.rst
index 48f9bc2..623eede 100644
--- a/doc/installation.rst
+++ b/doc/installation.rst
@@ -2,22 +2,58 @@ Installation
============
First of all, you'll need Python_.
-Any version where CFFI_ is supported should work.
-If you don't have Python installed yet, you should get one of the
-distributions which already include CFFI and NumPy_ (and many other useful
-things), e.g. Anaconda_ or WinPython_.
+There are many distributions of Python available,
+anyone where CFFI_ is supported should work.
-.. only:: html
+You can get the latest ``sounddevice`` release from PyPI_ (using ``pip``).
+But first, it is recommended to create a virtual environment
+(e.g. using `python3 -m venv`__ or `conda create`__).
+After activating the environment, the ``sounddevice`` module can be installed with::
+
+ python -m pip install sounddevice
+
+__ https://docs.python.org/3/library/venv.html
+__ https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-environments
+
+If you have already installed an old version of the module in the environment,
+you can use the ``--upgrade`` flag to get the newest release.
+To un-install, use::
+
+ python -m pip uninstall sounddevice
+
+If you want to try the very latest development version of the ``sounddevice`` module,
+have a look at the section about :doc:`CONTRIBUTING`.
+
+If you install the ``sounddevice`` module with ``pip`` on macOS or Windows,
+the PortAudio_ library (with ASIO support on Windows) will be installed
+automagically.
+On other platforms, you might have to install PortAudio with your package
+manager (the package might be called ``libportaudio2`` or similar).
+
+.. note::
+
+ If you install PortAudio with a package manager (including ``conda``),
+ it will override the version installed with ``pip``.
+
+The NumPy_ library is only needed if you want to play back and record NumPy arrays.
+The classes `sounddevice.RawStream`, `sounddevice.RawInputStream` and
+`sounddevice.RawOutputStream` use plain Python buffer objects and don't need
+NumPy at all.
+If needed -- and not installed already -- NumPy can be installed like this::
+
+ python -m pip install numpy
- .. image:: https://anaconda.org/conda-forge/python-sounddevice/badges/version.svg
- :target: https://anaconda.org/conda-forge/python-sounddevice
-If you are using the ``conda`` package manager (e.g. with Anaconda_ or Miniconda_ for
-Linux/macOS/Windows), you can install the ``sounddevice`` module from the
-``conda-forge`` channel::
+Alternative Packages
+--------------------
+
+If you are using the ``conda`` package manager (e.g. with miniforge_),
+you can install the ``sounddevice`` module from the ``conda-forge`` channel::
conda install -c conda-forge python-sounddevice
+You can of course also use ``mamba`` if ``conda`` is too slow.
+
.. note::
The PortAudio package on ``conda-forge`` doesn't have ASIO support,
@@ -36,52 +72,12 @@ There are also packages for several other package managers:
If you are using Windows, you can alternatively install one of the packages
provided at https://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice.
-The PortAudio_ library (with ASIO support) is included in the package and
+The PortAudio library (with ASIO support) is included in the package and
you can get the rest of the dependencies on the same page.
-Note that some of the aforementioned packages may be out-of-date.
-You can always get the newest ``sounddevice`` release from PyPI_
-(using ``pip``).
-If you want to try the latest development version, have a look at the section
-about :doc:`CONTRIBUTING`.
-
-To install the latest release from PyPI, use::
-
- python3 -m pip install sounddevice
-
-Depending on your Python installation,
-you may have to use ``python`` instead of ``python3``.
-If you have installed the module already, you can use the ``--upgrade`` flag to
-get the newest release.
-
-To un-install, use::
-
- python3 -m pip uninstall sounddevice
-
-If you install the ``sounddevice`` module with ``pip`` on macOS or Windows,
-the PortAudio_ library (with ASIO support on Windows) will be installed
-automagically.
-On other platforms, you might have to install PortAudio with your package
-manager (the package might be called ``libportaudio2`` or similar).
-
-You might also have to install CFFI_ (from a package called ``python3-cffi`` or
-similar).
-
-NumPy_ is only needed if you want to play back and record NumPy arrays.
-The classes `sounddevice.RawStream`, `sounddevice.RawInputStream` and
-`sounddevice.RawOutputStream` use plain Python buffer objects and don't need
-NumPy at all.
-If you need NumPy, you should install it with your package manager (from a
-package named ``python3-numpy`` or similar) or use a Python distribution that
-already includes NumPy (see above).
-You can also install NumPy with ``pip``, but depending on your platform, this
-might require a compiler and several additional libraries.
-
.. _PortAudio: http://www.portaudio.com/
.. _NumPy: https://numpy.org/
.. _Python: https://www.python.org/
-.. _Anaconda: https://www.anaconda.com/download#downloads
-.. _Miniconda: https://docs.conda.io/miniconda.html
-.. _WinPython: https://winpython.github.io/
+.. _miniforge: https://github.com/conda-forge/miniforge
.. _CFFI: https://cffi.readthedocs.io/
.. _PyPI: https://pypi.org/project/sounddevice/