Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: No module named 'textencoder' error when upgraded to python 3

Currently I have migrated my python2 django project to python 3 & after conversion to py3 I am getting below kind of error for below code.

from hubarcode.code128 import Code128Encoder
encoder = Code128Encoder(pur_num, {'is_reliable': False})

Trackeback is as below.

from hubarcode.code128 import Code128Encoder
File "D:\my_project\venv\lib\site-packages\hubarcode\code128__init__.py", line 16, in
from textencoder import TextEncoder
ModuleNotFoundError: No module named 'textencoder'

I have tried to search for solution online on google but not able to solve it.

Any suggestions ?

Thanks.

like image 326
Moon Avatar asked Dec 20 '25 18:12

Moon


1 Answers

I am able to solve issue by using pyStrich.

First you need to install pyStrich using pip3 install pyStrich and after thatn What you need to do is just replace from hubarcode.code128 import Code128Encoder with from pystrich.code128 import Code128Encoder.

I hope it may help others who have been facing same kind of problem.

like image 56
Moon Avatar answered Dec 23 '25 08:12

Moon