Error installing pyflycapture2 on Windows

1.2k views Asked by At

I am attempting to install this https://github.com/jordens/pyflycapture2 python binding on my Windows machine. The readme only has instructions on how to do it for Linux systems, but I imagine the library should still work.

I am able to run "python setup.py install" and it seems to successfully complete, but when I try to run "python test_flycapture2.py" I get this error:

C:\Users\clinic\Desktop\pyflycapture2>python test_flycapture2.py Traceback (most recent call last):   
File "test_flycapture2.py", line 20, in <module>
    import flycapture2 as fc2   
File "build\bdist.win-amd64\egg\flycapture2.py", line 7, in <module>   
File "build\bdist.win-amd64\egg\flycapture2.py", line 6, in __bootstrap__
ImportError: DLL load failed: The specified module could not be found.

This seems to imply that flycapture2 wasn't installed correctly. When I instead just open a python session and do "import flycapture2" I get the following error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build\bdist.win-amd64\egg\flycapture2.py", line 7, in <module>
File "build\bdist.win-amd64\egg\flycapture2.py", line 6, in __bootstrap__
ImportError: DLL load failed: The specified module could not be found.

Have I done something wrong with the installation process or does pyflycapture2 just not work with Windows?

2

There are 2 answers

1
Jenner Felton On BEST ANSWER

I'm answering this mostly because I found another post where the same question had been posted but the original problem was never answered.

How do I run an installed Python module on Windows?

In the comments, the original poster says that it suddenly started working. I found that the solution was simply to restart my computer. I have now attempted this on two computers and this worked for both of them.

0
Overdrivr On

A dumb solution that's worth a try. There are chances that the DLL are searched directly from where you're starting the python script. So if you have the dll somewhere on your computer, copy it along where you have your test_flycapture2.py.

But given the fact that the setup.py file has a whole bunch of absolute paths in there, I would not place my hopes too high. You can also try to install FlyCapture 2 at the exact same path, run python setup.py bdist_wheel (you will need to install wheel first with pip) in the pyflycapture2 folder, and see if that succeeds.

If it does, try installing the generated wheel (that will be in dist/ subfolder) by doing pip install dist/pyfly....wheel and test again.

Hope this helps