Forums

Cannot Install Package in Flask

Hello, <br> I am trying to install pdfkit. I used the bash console and entered 'pip3.5 install --user pdfkit' (also pip install --user pdfkit) and appears that the package was installed, as per pip freeze. The package has a dependency 'wkhtmltopdf' which appears to have installed successfully as well. <br> <br> However when I import module into my flask_app.py file it comes up with the following error: <br> <br>

// File "/home/tayljordan/qmapps/flask_app.py", line 5, in <module> import pdfkit ImportError: No module named 'pdfkit' // <br> <br> Any help would be appreciated. Thank you in advance.

When you created the Flask app, what version of Python did you specify?

3.4 - is there another package I can use to convert HMTL to PDF using 3.4?

You need to 'pip install' for the specific Python version you're using, so please try:

pip3.4 install --user pdfkit

I don't know the answer re. HTML to PDF in Python, but maybe my friend Google can help? In the past I successfully used a standalone utility called HTMLDOC, but that was for Windows.

HTH Jim

that was it - i did not specify the correct python version. thank for your help!