我是 python 的新手,但我找到的所有搜索结果对我来说都是无用的。
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'
这种情况一直在发生。感谢您的帮助。
更新:
我发现安装 Python 2.* 没问题,因为 main
模块在使用 print
时不正确(使用 2.* 版本)。
但是我还是想知道,有什么办法吗?
最佳答案
我是这样安装的,希望对你有用
pip install django-wkhtmltopdf
关于python - 没有名为 main 的模块,wkhtmltopdf 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29533177/