Skip to content

Commit

Permalink
Merge pull request #703 from mattaw/main
Browse files Browse the repository at this point in the history
Extended FAQ to include using PyVISA on Cygwin on Windows.
  • Loading branch information
MatthieuDartiailh committed Nov 22, 2022
2 parents 8d1bd15 + c3c7fd3 commit f017213
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions docs/source/faq/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ This error occurs when you have provided an invalid path for the VISA library.
Check that the path provided to the constructor or in the configuration file


Error: Could not found VISA library
-----------------------------------
Error: Could not find VISA library
----------------------------------

This error occurs when you have not provided a path for the VISA library and
PyVISA is not able to find it for you. You can solve it by providing the
PyVISA is not able to find it for you. You can solve it by creating a configuration
file as described in :ref:`intro-configuring` (recommended) or by providing the
library path to the ``VisaLibrary`` or ``ResourceManager`` constructor::

>>> visalib = VisaLibrary('/path/to/library')
Expand All @@ -70,7 +71,32 @@ or::

>>> rm = ResourceManager('Path to library')

or creating a configuration file as described in :ref:`intro-configuring`.
.. note::

If you get this error while trying to create a ``ResourceManager`` in Python built
for Cygwin (https://www.cygwin.com/) on Windows:

1. Check you are running the Cygwin build of Python by running ``python -VV``. If not, follow
the troubleshooting steps for Windows::

$ python -VV
Python 3.9.10 (main, Jan 20 2022, 21:37:52)
[GCC 11.2.0]

2. Specify the location of the ``visa32.dll`` or ``visa64.dll`` using the ``linux`` syntax
and Cygwin paths by creating a `.pyvisarc` (:ref:`intro-configuring`) file::

$ cat ~/.pyvisarc
[Paths]
VISA library: /cygdrive/c/Windows/System32/visa64.dll

or::

rm = visa.ResourceManager('/cygdrive/c/Windows/System32/visa64.dll')

or::

rm = visa.ResourceManager('/cygdrive/c/Windows/System32/visa32.dll')


Error: `visa` module has no attribute `ResourceManager`
Expand Down

0 comments on commit f017213

Please sign in to comment.