Issue using a new library in psychopy builder

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2023.1.3
Standard Standalone? (y/n) If not then what?:y

Hi, I am to use the pylibftdi library in psychopy, I can sucessfully import and use the library in the shell interface of psychopy but I have struggles when using the same lines of code in the code snippet within the builder. The library appears to be imported sucessfully because I don’t have error but it looks like my ftdi object is not detected. Given this inconsitent behavior within psychopy itself I am not sure what is going wrong.

Here are the lines of code working in the shell but not in the code snippet

from pylibftdi import BitBangDevice
from pylibftdi import Driver

def get_ftdi_device_list():
    dev_list = []
    for device in Driver().list_devices():
        vendor, product, serial = device
        dev_list.append("%s" % (serial))
    return dev_list

In the shell get_ftdi_device_list() will return my device name while in the code snippet I have an empty array.

Best,
Simon

Is there a possibility that the builder and shell are not using the packages in the same way (different dependencies)?
Just adding a picture to make sure what I mean with the “shell” (command window) thing.