![在 python 中导入 pdfkit 时显示错误](https://linux22.com/image/1070532/%E5%9C%A8%20python%20%E4%B8%AD%E5%AF%BC%E5%85%A5%20pdfkit%20%E6%97%B6%E6%98%BE%E7%A4%BA%E9%94%99%E8%AF%AF.png)
我在 Ubuntu 中使用 python3 进行编码...我已经安装了 pip
sudo apt install python3-pip
版本
pip3 --version
输出
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
安装 wkhtmltopdf:
sudo apt-get install wkhtmltopdf
wkhtmltopdf 版本输出
wkhtmltopdf 0.12.4
安装 pdfkit
pip install pdfkit
当我在 pycharm 中使用 pdfkit 示例时
import pdfkit
pdfkit.from_url('http://google.com', 'out.pdf')
pdfkit.from_file('test.html', 'out.pdf')
pdfkit.from_string('Hello!', 'out.pdf')
是显示
/home/user/PycharmProjects/pythonProject/venv/bin/python "/home/user/PycharmProjects/sample project/venv/pipSample.py"
Traceback (most recent call last):
File "/home/user/PycharmProjects/sample project/venv/pipSample.py", line 1, in <module>
import pdfkit
ModuleNotFoundError: No module named 'pdfkit'
Process finished with exit code 1
我想要大家回复一下...