dvcoolarun / web2pdf

🔄 CLI to convert Webpages to PDFs 🚀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

import error

herschelrs opened this issue · comments

Tried to run this myself, running arch

(web2pdf) $ python main.py 
Fontconfig error: "/etc/fonts/local.conf", line 1: XML declaration not well-formed // I believe this is unrelated
Traceback (most recent call last):
  File "/~~~/p/web2pdf/main.py", line 7, in <module>
    from readability import Document
ImportError: cannot import name 'Document' from 'readability' (/~~~/.local/share/virtualenvs/web2pdf-VRO491p1/lib/python3.9/site-packages/readability/__init__.py)

with:

pipenv, version 2023.12.1
Python 3.9.18

I also checked, I don't see a Document property on readability if I just open a shell and import it. Just from a glance at your code I'm pretty confused what's going wrong here.

commented

Ah, I think there is an extra import for package readability. In actuality, I have used readability-lxml.

Please check https://pypi.org/project/readability-lxml/