'NoneType' object is not callable
Пытаюсь сохранить картинку со штрихкодом:
import barcode
from barcode.writer import ImageWriter
def show_barcode(message,tekUser):
EAN = barcode.get_barcode_class('ean13')
ean = EAN(tekUser.karta, writer=ImageWriter())
fullname = ean.save('c:\\'+str(tekUser.chat_id))
Получаю ошибку TypeError: **'NoneType' object is not callable**
Определил что ошибка возникает при вызове ImageWriter()
Что я делаю не так и как правильно?
Traceback (most recent call last):
File "C:\Python\lib\site-packages\telebot\util.py", line 62, in run task(*args, **kwargs)
File "C:/SlawaBot/main.py", line 58, in inlin
show_barcode(c.message,tekUser)
File "C:\SlawaBot\users.py", line 50, in show_barcode
ean = EAN(tekUser.karta, writer=ImageWriter())
TypeError: 'NoneType' object is not callable
"Traceback (most recent call last):
File "C:/SlawaBot/main.py", line 126, in <module>
bot.polling(none_stop=True)
File "C:\Python\lib\site-packages\telebot\__init__.py", line 415, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "C:\Python\lib\site-packages\telebot\__init__.py", line 439, in __threaded_polling
self.worker_pool.raise_exceptions()
File "C:\Python\lib\site-packages\telebot\util.py", line 111, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "C:\Python\lib\site-packages\six.py", line 703, in reraise
raise value
File "C:\Python\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
File "C:/SlawaBot/main.py", line 58, in inlin
show_barcode(c.message,tekUser)
File "C:\SlawaBot\users.py", line 50, in show_barcode
ean = EAN(tekUser.karta, writer=ImageWriter())
TypeError: 'NoneType' object is not callable
tekUser.karta не NULL, проверял
Python 3.8, что и где править надо?
насчет pillow
Requirment alredy satisfied
Оба пакета в одной и той же папке