I am trying to create executable file from my script by using auto-py-to-exe. Once I run this exe file, following error occurs:
Traceback (most recent call last): File "GUI_PDF_scraper.py", line 5, in ModuleNotFoundError: No module named 'camelot'
Code below:
from tkinter import *
from tkinter import filedialog
import os
import camelot
import shutil
import pandas as pd
# ======================== functions ==============================================================================
file_name = []
def search_for_file_path():
global file_name
current_dir = os.getcwd()
file = filedialog.askopenfile(parent=window, initialdir=current_dir, title='Please select a directory')
file_name = file.name
file_entry.insert(0, file_name)
def scrapping():
global file_name
dfs = []
# camelot reader / this two lines reads and export pdf pages to separate CSV files
tables = camelot.read_pdf(str(file_name), pages="1-end")
tables.export('data.csv', f='csv', compress=False)
for root, dirs, files in os.walk("./"):
# select file name
for file in files:
# check the extension of files
if file.endswith('.csv'):
# append dataframes to the list of dataframes
dfs.append(pd.read_csv(file))
# creation of concatenated dataframes(panda) / if df is just one concatenation is not needed
if len(dfs) < 2:
dfs[0].to_csv("result_/final_file.csv", index=False)
else:
merged = pd.concat(dfs)
merged.to_csv("result_/final_file.csv", index=False)
# working files move to trash and removal from trash directory
source = os.listdir("./")
destination = "./trash_"
for files in source:
if files.endswith(".csv"):
shutil.move(files, destination)
os.remove(f"trash_/{files}")