To fix the ModuleNotFoundError, please follow these steps:
- First, install Poetry if not already installed:
curl -sSL https://install.python-poetry.org | python3 -
- After installing Poetry, run these commands in the project directory:
# Install all dependencies
poetry install
# Activate the virtual environment
poetry shell
- Once the virtual environment is activated, you can run your script:
python convert_pdf.py
This will ensure all required dependencies, including 'filetype', are properly installed in the project's virtual environment.