python-microscope / microscope

Python library for control of microscope devices, supporting hardware triggers and distribution of devices over the network for performance and flexibility.
https://www.python-microscope.org
GNU General Public License v3.0
69 stars 41 forks source link

Issue while trying the Python Microscope on a xiB-64 camera #142

Open john-wigg opened 4 years ago

john-wigg commented 4 years ago

Hello, I tried to quickly run python Microscope on a ximea Camera using the following code

import microscope
from microscope.cameras.ximea import XimeaCamera
cam = XimeaCamera()

class DataClient(queue.Queue):
    def receiveData(self, *args):
        self.put(args)

buffer = DataClient()
cam = TestCamera()
cam.initialize()
cam.enable()
cam.set_client(buffer)

cam.soft_trigger()
img = buffer.get()

and I get the following error message in the terminal:

Traceback (most recent call last):
  File "testmicroscope.py", line 2, in <module>
    from microscope.cameras.ximea import XimeaCamera
ImportError: No module named ximea

my camera is a CB013MG-LX-X8G3 (xiB-64), I have the 4.19.21 version of the API package.

Thanks for the help

NickHallPhysics commented 4 years ago

Hi!

That looks like the API is not in the Python path. To confirm, have you moved the Python3 ximea package (found in the XIMEA\API\Python\v3 of the XIMEA folder the installer creates) into the Python path? If not, do so and check if the error persists

Edit: I anticipate you will have further errors since, for example, you are overloading the cam variable and have not defined TestCamera(). But moving the Python ximea package to the path should fix the ImportError.

iandobbie commented 4 years ago

The error seems more like it is an older version of microscope from before the ximea module was in the master branch.

Do you even have a file microscope/cameras/ximea.py from you microscope install directory?

carandraug commented 4 years ago

The error seems more like it is an older version of microscope from before the ximea module was in the master branch.

@john-wigg are by any chance using Python 2? Python 2 is not supported since version 0.3.0 and there was no support for ximea cameras back then.

iandobbie commented 3 years ago

@john-wigg Did you manage to solve this issue?

john-wigg commented 3 years ago

Oh, I'm afraid my supervisor, @FReina accidentally used my account to open this issue (I should be more careful to properly log out). I'll let him know, maybe he can answer.