Error "name 'collect_ibkr_listings' is not defined"

When calling collect_ibkr_listings(exchanges="FREE") I get this error "name 'collect_ibkr_listings' is not defined"

My code:

from quantrocket.master import collect_ibkr_listings
collect_ibkr_listings(exchanges="FREE")

Complete error message:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [27], in <cell line: 1>()
----> 1 collect_ibkr_listings(exchanges="FREE")

NameError: name 'collect_ibkr_listings' is not defined
​

I'm connected to IB GUI and the gateway is started.

What could be the reason for this error and how can I fix it?

Although you show the import statement in your pasted code:

from quantrocket.master import collect_ibkr_listings

The traceback says it wasn’t there, as line 1 is:

----> 1 collect_ibkr_listings(exchanges="FREE")

Double check you include and execute the import statement before using the function.