Error in .exe of python script having Barcode from Reportlab.graphics

I have a python script for generating barcodes (code128) which works fine in IDE.

But when converted into exe, it encounters below error:

Traceback (most recent call last):
  File "amazonbarcode-dubai.py", line 6, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "reportlab\graphics\barcode\__init__.py", line 76, in <module>
  File "reportlab\graphics\barcode\__init__.py", line 42, in _reset
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "reportlab\graphics\barcode\widgets.py", line 166, in <module>
  File "reportlab\graphics\barcode\widgets.py", line 95, in _BCW
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'reportlab.graphics.barcode.code128'

I tried import code128 from reportlab.graphics.barcode that also works fine with IDE but fails in exe.

Below is my python script:

import os
import pandas as pd
from reportlab.pdfgen import canvas
from reportlab.graphics import barcode
from reportlab.lib.units import mm

cwd = os.getcwd()

df1 = pd.read_csv(cwd+'\\exportedTable.csv')
df2 = pd.read_excel(cwd+'\\AMAZON BARCODE.xlsx',dtype=str)
df3 = pd.merge(df1,df2,left_on='ASIN',right_on='amazonasin',how='left')

df_missing = df3[df3.item.isnull()]
if df_missing.size>0:
    print(df_missing.to_string())
    print(df_missing.columns)
    df_missing = df_missing[['Model number','UPC/EAN/ISBN','ASIN']]
    df_missing.to_excel(cwd+'\\amazonmissingbarcode.xlsx',index=False)


df3 = df3.sort_values('model').reset_index()
df3['ctn'] = df3.index+1
df3 = df3[['ctn','model','barcode','amazonasin','Package tracking ID','PO number']]
df3.columns = ['ctn','model','ean','asin','accn','pono']
print(df3.to_string())

f = df3.pono.unique()[0]
cb = canvas.Canvas(f+'-big.pdf')
cb.setPageSize((100*mm,75*mm))

barcode = barcode.code128.Code128

for i,row in df3.iterrows():
    
    barcode(row['asin'],barHeight=20*mm,barWidth=0.5*mm).drawOn(cb,9*mm,53*mm)
    cb.setFont("Helvetica",10)
    cb.drawCentredString(54*mm,50*mm,'ASIN : ' + row['asin'])

    barcode(row['pono'],barHeight=15*mm,barWidth=0.5*mm).drawOn(cb,15*mm,32*mm)
    cb.setFont("Helvetica",10)
    cb.drawCentredString(54*mm,29*mm,'PO NO. : '+row['pono'])

    barcode(row['accn'],barHeight=15*mm,barWidth=0.4*mm).drawOn(cb,7*mm,12*mm)
    cb.setFont("Helvetica",10)
    cb.drawCentredString(54*mm,9*mm,row['accn'])

    cb.setFont("Helvetica-Bold",12)
    cb.drawString(5*mm,4*mm,'MODEL: '+row['model'])
    cb.drawRightString(95*mm,4*mm,'CTN NO.: '+str(row['ctn']))

    cb.showPage()

cb.save()
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum