Why am I getting the error that BAC0 has no attribute 'connect'

275 views Asked by At

I am getting started with trying to retrieve information from BACnet/IP devices. I found out that the BAC0 module in python can be used for this. These 3 lines should return information but instead, I get an error that "module BAC0 has no attribute 'connect'. But I know for sure that the BAC0 modules does have this attribute. This error also occurs when I leave the .connect() arguments list blank. What am I doing wrong? I also have bacpypes module installed and I'm using python3.

enter image description here

I was expecting information about BACnet devices on my network.

2

There are 2 answers

1
Steven Smethurst On

It looks like you have imported the BAC0 library but you have not instantiated the class as "BACnet".

This is a programing language issue not a BACnet or BAC0 library issue

0
NewCoder123 On

You can try,

pip install pytz

Simply run your python script after installing pytz library.