Search code examples
pythonwkhtmltopdf

No module named main, wkhtmltopdf issue


I'm new in python, but all search results i found was useless for me.

    C:\Users\Aero>pip install wkhtmltopdf
Collecting wkhtmltopdf
  Using cached wkhtmltopdf-0.2.tar.gz
Installing collected packages: wkhtmltopdf
  Running setup.py install for wkhtmltopdf
Successfully installed wkhtmltopdf-0.2

C:\Users\Aero>python
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wkhtmltopdf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python34\lib\site-packages\wkhtmltopdf\__init__.py", line 1, in <module>
    from main import WKhtmlToPdf, wkhtmltopdf
ImportError: No module named 'main'

That is happening all the time. Thanks for any help.

Update:
I find that installing Python 2.* makes it okay, cause of main module isn't correct while using print (Using 2.* version).
But i still want to know, it there any ways?


Solution

  • Seems there is some error with package installation of wkhtmltopdf. It wasn't working for me then i uninstalled the package and re-installed it by doing

    python -m pip uninstall wkhtmltopdf
    

    and then

    python -m pip install wkhtmltopdf
    

    it worked for me.try this it may work.