Skip to content

Commit

Permalink
Merge pull request #747 from arr-ee/doc-fixes
Browse files Browse the repository at this point in the history
doc: remove no longer relevant mentions of `visa` module + more bitness fixes
  • Loading branch information
MatthieuDartiailh committed Jun 7, 2023
2 parents 55f01db + 7c08813 commit 071fa6d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
33 changes: 11 additions & 22 deletions docs/source/faq/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,11 @@ or::

or::

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

or::

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


Error: `visa` module has no attribute `ResourceManager`
-------------------------------------------------------

The https://github.com/visa-sdk/visa-python provides a visa package that can
conflict with :py:mod:`visa` module provided by PyVISA, which is why the
:py:mod:`visa` module is deprecated and it is preferred to import
:py:mod:`pyvisa` instead of :py:mod:`visa`. Both modules provides the
same interface and no other changes should be needed.
rm = pyvisa.ResourceManager('/cygdrive/c/Windows/System32/visa32.dll')


Error: No matching architecture
Expand Down Expand Up @@ -136,12 +126,12 @@ following debug command::

pyvisa-info

You will see the 'bitness' of the Python interpreter and at the end you will
You will see the architecture the Python interpreter was compiled for, and at the end you will
see the list of VISA libraries that PyVISA was able to find.

The solution is to:

1. Install and use a VISA library matching your Python 'bitness'
1. Install and use a VISA library matching your Python architecture

Download and install it from **National Instruments's VISA**. Run the
debug command again to see if the new library was found by PyVISA. If not,
Expand All @@ -152,25 +142,24 @@ The solution is to:

or

2. Install and use a Python matching your VISA library 'bitness'
2. Install and use a Python matching your VISA library architecture

In Windows and Linux: Download and install Python with the matching
bitness. Run your script again using the new Python

In Mac OS X, Python is usually delivered as universal binary (32 and
64 bits).
In macOS, Python is usually delivered as universal binary (x86_64 and arm).

You can run it in 32 bit by running::
You can run it in x86_64 mode by running::

arch -i386 python myscript.py
arch -x86_64 python myscript.py

or in 64 bits by running::
or in arm mode by running::

arch -x86_64 python myscript.py
arch -arm64 python myscript.py

You can create an alias by adding the following line

alias python32="arch -i386 python"
alias pythonx86="arch -x86_64 python"

into your .bashrc or .profile or ~/.bash_profile (or whatever file
depending on which shell you are using.)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/introduction/configuring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Failing that, it uses the pyvisa-py backend.
You can also select a desired backend by passing a parameter to the
ResourceManager, shown here for pyvisa-py:

>>> visa.ResourceManager('@py')
>>> pyvisa.ResourceManager('@py')

Alternatively it can also be selected by setting the environment variable
PYVISA_LIBRARY. It takes the same values as the ResourceManager constructor.
Expand Down

0 comments on commit 071fa6d

Please sign in to comment.