# How to Fix "TL Call Failed" Error When Running Python Code?

**URL:** <https://forum.commonvisionblox.com/t/how-to-fix-tl-call-failed-error-when-running-python-code/2357>\
**Category:** Python API\
**Tags:** acquisition, gigevision, python\
**Created:** [February 6, 2025, 10:37am UTC](https://forum.commonvisionblox.com/t/how-to-fix-tl-call-failed-error-when-running-python-code/2357 "2025-02-06T10:37:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mo212](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@Mo212](https://forum.commonvisionblox.com/u/Mo212)\
**Post date:** [February 6, 2025, 10:37am UTC](https://forum.commonvisionblox.com/t/how-to-fix-tl-call-failed-error-when-running-python-code/2357/1 "2025-02-06T10:37:26Z")

</div>

Hello everyone!  
I’m new to the software and trying to run my program using Python, but I keep encountering the following error from the start:

```auto
device = cvb.DeviceFactory.open(cvb.install_path() + "Drivers/GenICam.vin")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: TL call failed

```

Here is my Python code:

```auto

import os
import cvb
 
device = cvb.DeviceFactory.open(cvb.install_path() + "Drivers/GenICam.vin")
img_stream = device.stream
img_stream.start()
img_stream.stop()
device.close()

```

---

<div class="post-metadata">

**Author:** ![Chris](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/chris/32/1154_2.png) [@Chris](https://forum.commonvisionblox.com/u/Chris)\
**Post date:** [February 11, 2025, 2:47pm UTC](https://forum.commonvisionblox.com/t/how-to-fix-tl-call-failed-error-when-running-python-code/2357/2 "2025-02-11T14:47:23Z")

</div>

Hi @Mo212 ,

First of all I want to say sorry for the delay here.  
Lets jump right into solving your problem.  
Have you tried the fix from this post?:

[https://forum.commonvisionblox.com/t/cvb-devicefactory-open-error-valueerror-failed-to-load-device-object/497](https://forum.commonvisionblox.com/t/cvb-devicefactory-open-error-valueerror-failed-to-load-device-object/497)

In addition: instead of simply loading the GenICam.vin, you might want to use our discover interface to be a bit more flexible in which of the devices you actually want to open.  
The code would look like this:

```auto
devices = cvb.DeviceFactory.discover_from_root(cvb.DiscoverFlags.IgnoreTLs | cvb.DiscoverFlags.IgnoreGevSD)
with cvb.DeviceFactory.open(devices[0].access_token, cvb.AcquisitionStack.Vin) as device:
    test = "donothing"

```

At this point however, I would like to suggest to you to use our latest acquisitionstack (3rd gen).

The code for discorvering devices and loading them in this case looks like this:

```auto
devices = DeviceFactory.discover_from_root(DiscoverFlags.IgnoreVins) # or any other flag combination e.g.

devices = DeviceFactory.discover_from_root(cvb.DiscoverFlags.IgnoreVins | DiscoverFlags.IgnoreGevSD)

with DeviceFactory.open(devices[0].access_token, AcquisitionStack.GenTL) as device:

```

You can use the MigrationGuide for the Acquisition stacks:  
[https://help.commonvisionblox.com/NextGen/14.1/md\_theory\_of\_operation\_image\_manager\_\_migration\_guide\_\_acquisition\_stack.html#py-discover-and-open](https://help.commonvisionblox.com/NextGen/14.1/md_theory_of_operation_image_manager __migration_guide__ acquisition_stack.html#py-discover-and-open)

This is a very nice summary of the most important stept when getting started with programming in CVB for each of our language wrappers.

I hope this helps you with your application.  
Cheers  
Chris
