PyVISA Setup in Windows


I’d imagine that the PyVISA setup usually goes much more smoothly in Linux than it does in Windows… Whatever, I jotted notes down on the process I went through in order to make it work. So, you benefit.

Download the following:

  1. python or python xy – I don’t know if python 3 works…
  2. ni-visa – Go to the download section and get the latest version.
  3. ni-488.2 – If you don’t already have your usb/pci gpib controller installed, grab the latest version.
  4. pyvisa – Get the tarball of the latest version.
  5. notepad++ – My fav text editor.

And now for the trickery:

  1. Install python, ni-visa, and notepad++
  2. If you already have the gpib controller installed, skip installing ni-488.2 (it’s more trouble than it’s worth to upgrade)
  3. Else install ni-488.2 and add you gpib controller through the ni-488.2 software as well as any windows hardware popup installers.
  4. If you grabbed python from python.org, you might need to add python to your system path by navigating to start menu->control panel->system->advanced tab->environment variables and adding ;C:\Python26 to the PATH variable.
  5. If you grabbed python xy, you should be fine.
  6. Extract PyVISA to anywhere that is easy to navigate to in the cmd line, C:\PyVISA-1.3\ for example.
  7. Open up setup.cfg and setup.py in notepad++ and make the changes as listed in this bug report.
  8. Open up a command line by going to the start menu->run and passing it cmd
  9. In the command line window, navigate to the PyVISA folder.
  10. Typing in the command python setup.py install should automatically install PyVISA to the C:\python\Lib\site-packages\ directory

If it doesn’t work, check setup.cfg, setup.py or the path variable to see that you did it correctly. If you have issues with the gpib controller, uninstall 488.2 completely (it comes with many parts) and reinstall 488.2 and re-add controller.

About these ads

5 Responses to PyVISA Setup in Windows

  1. me says:

    Thank you so very very much!!!
    So kind of you to make this post. Bless you!

  2. psonghi says:

    Glad you found it useful ;)

  3. nitin says:

    Hi Does Pyvisa work with a 64bit process? I can run Pyvisa for x86 process but it does setattribute error when i call pyvisa from a x64bit process. Please help. Thanks, Nitin

  4. Rene says:

    THANK YOU!!!!!

  5. Adi says:

    Apparently this is missing one last step and that is that you have to copy C:\python\Lib\site-packages\PyVisa*.egg directory’s PY modules into C:\python\Lib folder.

    then it should work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: