aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Rossetto <aaron.rossetto@ni.com>2020-09-01 11:45:40 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-09-03 11:49:12 -0500
commit61e10fc6b689df44f0a527861ca23801947f7e62 (patch)
tree293f7f66e9e08a8914e886683c0c97e321912fbd
parent6d414a4f2276da455e77dc1a436827349e596d79 (diff)
downloaduhd-61e10fc6b689df44f0a527861ca23801947f7e62.tar.gz
uhd-61e10fc6b689df44f0a527861ca23801947f7e62.tar.bz2
uhd-61e10fc6b689df44f0a527861ca23801947f7e62.zip
docs: Add Windows-specific UHD Python module notes
-rw-r--r--host/docs/pythonapi.dox30
1 files changed, 30 insertions, 0 deletions
diff --git a/host/docs/pythonapi.dox b/host/docs/pythonapi.dox
index 8015034a5..2207608c4 100644
--- a/host/docs/pythonapi.dox
+++ b/host/docs/pythonapi.dox
@@ -23,6 +23,36 @@ Note that since UHD version 4.0.0.0, Python 2 is no longer supported.
Static linking on is unsupported on Windows. Otherwise, compiling the Python API
on Windows is no different from other operating systems.
+Note that you may have to set the `PYTHONPATH` environment variable to ensure
+that Python is able to find the UHD package. For example, if the UHD install
+base path is `C:\Program Files (x86)\UHD`:
+
+ set PYTHONPATH=%PYTHONPATH%;C:\Program Files (x86)\UHD\lib\site-packages
+
+<b>Python 3.8 Note:</b> If you receive an error similar to this when running
+`import uhd` in Python 3.8 and above on Windows:
+
+ ImportError: DLL load failed while importing libpyuhd: The specified module could not be found.
+
+this indicates a problem finding one or more of the DLLs that the UHD Python
+module depends on to load correctly.
+
+Python 3.8
+<a href="https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew">includes
+a change</a> to the paths Windows searches when attempting to find a module's
+dependent DLLs. To ensure that Python is able to find and load the DLLs
+required to import the UHD module, it is advised that the uhd.dll and
+libusb-1.0.dll (if UHD was build with USB support) DLLs be copied to one of
+the following directories:
+
+- The `%%windows%\system32` directory
+- The directory where the Python UHD package is installed (by default, this
+ is `C:\Program Files (x86)\UHD\lib\site-packages\uhd`
+- The directory from which the Python executable is run
+- Paths added to the import extension module DLL search path via Python's
+ <a href="https://docs.python.org/3/library/os.html#os.add_dll_directory">os.add_dll_directory</a>
+ function
+
\subsection python_install_adv Advanced Usage Notes
UHD uses the PyBind11 library to generate its Python bindings. UHD ships its own