Pyxid2 installation

Hi, I am trying to use python and StimTracker to generate a pulse. I am stuck at pyxid2 installation. I’ve tried installing it on Anaconda with python 3.6 and newest Anaconda with python 3.8. I’ve tried installing it from github repository https://github.com/cedrus-opensource/pyxid/ using “python setup.py install” and I’ve tried using “pip install pyxid2”.
Unfortunately, I keep getting errors upon calling “import pyxid2”
Currently I am stuck with error: “FileNotFoundError: Could not find module ‘ftd2xx.dll’ (or one of its dependencies). Try using the full path with constructor syntax.”
The driver was installed under c://Windows/Sysyem32/DriveStore
Is there anything else I should install besides the pyxid2 repository?
Thank you in advance for your help

Solved.
It turned out that this particular error (“Could not find module ‘ftd2xx.dll’”) was because the device was not physically connected. However, I also run into the next error about win32con module missing. Although I installed pywin32 and pypiwin32 I got an error on: “from win32con import GENERIC_READ, GENERIC_WRITE, OPEN_EXISTING” within the source ftd2xx.py file
The following forum helped me solve it, and now everything works:


I added
import win32.lib.win32con as win32con
and then changed the problematic import to:
#from win32con import GENERIC_READ, GENERIC_WRITE, OPEN_EXISTING
def w32CreateFile(name, access=win32con.GENERIC_READ|win32con.GENERIC_WRITE,
flags=OPEN_BY_SERIAL_NUMBER):
return FTD2XX(_ft.FT_W32_CreateFile(_ft.STRING(name),
_ft.DWORD(access),
_ft.DWORD(0),
None,
_ft.DWORD(win32con.OPEN_EXISTING),
_ft.DWORD(flags),
_ft.HANDLE(0)))
I hope this helps someone in the future.
1 Like

Thank you for the detailed response that will benefit other forum visitors as well, I’m sure.