...
- First off, we need to install pip to install everything else
- [These instructions could be superseded if the method for installing pip gets updated. Pay attention to instructions at provided link]
- Download the get-pip.py script from:
- In the directory where you downloaded get-py.py, run it (from the Command Prompt) as
- py get-py.py
- You may need to update the Windows path (pip told me so - basically yellow script saying such and such was not in path). To do so:
- Search in search bar for: Advanced system settings
- Click: Environment Variables
- Under System variables, click on: Path
- Click Edit...
- Click New
- Enter path, as printed by pip on your command prompt, C: and all
- In our case, this was: C:\Users\LabUser\AppData\Local\Programs\Python\Python39\Scripts
- pip should now be working
- Now time to use pip to install a bunch of important Python libraries. Run all of these, from the command prompt :
- pip install numpy
- pip install scipy
- pip install matplotlib
- pip install astropy
- pip install pyvisa
- pip install pyvisa-py
- Yes, you must do this IN ADDITION to just pyvisa
- pip install pyserial
- DO NOT install the serial library. This confuses python when you say 'import serial' (we want it to import pyserial)
- pip install zaber-motion
- pip install pyusb
- In one installation, I started getting the following error with pyusb:
- ValueError: PyUSB does not appear to be properly installed Please refer to PyUSB documentation and install suitable backend like libusb 0.1, libusb 1.0, libusbx, libusb-win32 or OpenUSB. No backend available.
- BEFORE YOU CONTINUE WITH BELOW SOLUTION, CONTINUE WITH REST OF DOWNLOAD (point j. below). Continuing on may get things where they need to be.
- Solving this was a little tricky:
- Solved with the help of this page on stack overflow: https://stackoverflow.com/questions/33972145/pyusb-on-windows-8-1-no-backend-available-how-to-install-libusb
- Download pyusb from this link: http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.20/libusb-1.0.20.7z/download
- To unpack it, you need to be able to open .7z files.
- Install 7-zip from here: https://www.7-zip.org/
- move downloaded libusb-1.0.20.7z into its own directory called libusb
- right-click on libusb-1.0.20.7z, find the 7-zip option, place cursor over it, and select Extract Here from the menu
- Copy the file libusb-1.0.dll (in the libusb\MS64\dll directory) to C:\Windows\System32 (may require admin permission to do so - but just try copy and past in the Windows finder system)
- Now Keysight I/O libraries
- (sadly, cannot be done from command line)
- Go to: http://www.keysight.com/find/iosuite
- Scroll down, make sure "Current Version" and "Windows" are selected
- Scroll down and click on Download IOSL 2022 (or whatever year is)
- Run the downloaded .exe file.
- You should now be able to talk to the monochromator, the translation stages, and the Keysight current meters/volt meters/voltage sources. Let's test that:
...