No module named main, wkhtmltopdf issue

2024/10/3 2:18:19

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

    C:\Users\Aero>pip install wkhtmltopdf
Collecting wkhtmltopdfUsing cached wkhtmltopdf-0.2.tar.gz
Installing collected packages: wkhtmltopdfRunning setup.py install for wkhtmltopdf
Successfully installed wkhtmltopdf-0.2C:\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?

Answer

i solve it installing it this way, i hope it work for you

pip install django-wkhtmltopdf
https://en.xdnf.cn/q/70776.html

Related Q&A

Is there a Python shortcut for variable checking and assignment?

Im finding myself typing the following a lot (developing for Django, if thats relevant):if testVariable then:myVariable = testVariable else:# something elseAlternatively, and more commonly (i.e. buildi…

python scipy Delaunay plotting point cloud

I have a pointlist=[p1,p2,p3...] where p1 = [x1,y1],p2=[x2,y2] ...I want to use scipy.spatial.Delaunay to do trianglation on these point clouds and then plot itHow can i do this ?The documentation for…

Pythonic way to verify parameter is a sequence but not string

I have a function that gets a list of DB tables as parameter, and returns a command string to be executed on these tables, e.g.:pg_dump( file=/tmp/dump.sql,tables=(stack, overflow),port=5434name=europe…

How to get a random (bootstrap) sample from pandas multiindex

Im trying to create a bootstrapped sample from a multiindex dataframe in Pandas. Below is some code to generate the kind of data I need.from itertools import product import pandas as pd import numpy a…

Python Regex - replace a string not located between two specific words

Given a string, I need to replace a substring with another in an area not located between two given words.For example:substring: "ate" replace to "drank", 1st word - "wolf"…

Vectorized Lookups of Pandas Series to a Dictionary

Problem Statement:A pandas dataframe column series, same_group needs to be created from booleans according to the values of two existing columns, row and col. The row needs to show True if both cells …

Why cant I get my static dir to work with django 1.3?

This problem is very simple, but I just cant figure it outadded to my urlpatternsurl(r^static/(?P<path>.*)$, django.views.static.serve, {document_root: /home/user/www/site/static})where my main.…

Desktop Launcher for Python Script Starts Program in Wrong Path

I can not launch a python script from a .desktop launcher created on Linux Mint 17.1 Cinnamon.The problem is that the script will be launched in the wrong path - namely the home folder instead of the d…

How does numpy broadcasting perform faster?

In the following question, https://stackoverflow.com/a/40056135/5714445Numpys broadcasting provides a solution thats almost 6x faster than using np.setdiff1d() paired with np.view(). How does it manage…

python check if utf-8 string is uppercase

I am having trouble with .isupper() when I have a utf-8 encoded string. I have a lot of text files I am converting to xml. While the text is very variable the format is static. words in all caps should…