3

I am using Python version 3.6, Django version 1.9 and wkhtmltopdf version 0.2. My Python is not GCC it's Anaconda3.

When running my project which uses wkhtmltopdf, following error will be thrown:

from main import WKhtmlToPdf, wkhtmltopd
ModuleNotFoundError: No module named 'main'

This is how I imported the wkhtmltopdf:

import pdfkit
from wkhtmltopdf.views import PDFTemplateView
colidyre
  • 4,170
  • 12
  • 37
  • 53

2 Answers2

3

Yes i got the answer. This error occurred because i didn't installed django-wkhtmltopdf. installed >> `pip install django-wkhtmltopdf

I hope this answer will help to resolve the similar error.

2

after installing pdfkit with following command and pointing python version 3.8, i was able to get pdfkit working on mac

pip3 install pdfkit
Vijay
  • 143
  • 1
  • 1
  • 10