Visual studio Code (Code-Oss): TypeError: an integer is required(got type bytearray)

Hello everyone
I have this type of error: an integer is required (got type bytearray) when running the code:
from adafruit_servokit import Servokit
myKit= ServoKit(channels=16)

the error message:
dlinano@jetson-nano:~/Desktop/pyPro$ /usr/bin/python3 /home/dlinano/Desktop/pyPro/
Traceback (most recent call last):
File “/home/dlinano/Desktop/pyPro/”, line 2, in
File “/usr/local/lib/python3.6/dist-packages/”, line 92, in init
self._pca.frequency = 50
File “/usr/local/lib/python3.6/dist-packages/”, line 158, in frequency
old_mode = self.mode1_reg # Mode 1
File “/usr/local/lib/python3.6/dist-packages/adafruit_register/”, line 87, in get
i2c.write_then_readinto(buf, buf, out_end=1, in_start=1)
File “/usr/local/lib/python3.6/dist-packages/adafruit_bus_device/”, line 156, in write_then_readinto
File “/usr/local/lib/python3.6/dist-packages/”, line 92, in writeto_then_readfrom
in_start=in_start, in_end=in_end, stop=stop)
File “/usr/local/lib/python3.6/dist-packages/adafruit_blinka/microcontroller/generic_linux/”, line 61, in writeto_then_readfrom
readin = self._i2c_bus.read_i2c_block_data(address, buffer_out[out_start:out_end], in_end-in_start)
File “/usr/local/lib/python3.6/dist-packages/Adafruit_PureIO-0.2.3-py3.6.egg/Adafruit_PureIO/”, line 207, in read_i2c_block_data
TypeError: an integer is required (got type bytearray)
Cleaning up pins

Here is picture:

P/s: I run in python 3.6.9 64-bit
Do anyone have a solution to fix this error please help me


Thanks for your question.

It looks like you are using a custom app.
Could you share a simple reproducible source with us debugging?


Thanks for your reply
Yeah, I am using Visual Studio Code (Code Oss) to debug and the source code that I use that come youtube channels you can check the link below:
[] (it at 35:23 you will see the source code)
Probably, I think the python version 3.6.9 64bit it not compatible with the source code.


Sorry for the late.

It looks like you are facing the similar issue as this topic:

Please check the suggestion and comment to see if helps.