tatuylonen/wikitextprocessor

Cannot import 'Page'

thelahunginjeet opened this issue · 2 comments

Hi,

Thanks for this project! I started looking into parsing Wiktionary XML dumps and quickly decided using your package is the better part of valor.

Sorry, this is probably just something dumb, but after I install (via pip) and attempt:

from wikitextprocessor import Wtp, WikiNode, NodeKind, Page

I get a "cannot import name 'Page'" error (but no problem with the other three). This is on a Mac Workstation (OSX 10.14.6) with python 3.8.

I also tried to install from source but I get an "SSL certificate problem: certificate has expired" when pip tries to clone luajit. (So that fails.)

Any idea what is going on here?

xxyzz commented

The pypi.org package is outdated and thus the README lists install from source commands first. I think some part of the code uses API introduced since Python 3.9, so if you're using 3.8 you'll get runtime error.

luajit is the dependency of the lupa package, lupa by default doesn't build luajit on macos but I guess they still need to be cloned. Maybe your system's certifications need update, I just cloned the luajit repo and didn't get "certificate has expired" error. Can you open https://luajit.org/ in safari?

Thanks for the quick response, and the tip about Python 3.9. I shouldn't have bothered you with this problem; it was an issue with how MacOS handles SSL certificates. In case you are curious:

https://stackoverflow.com/questions/69521959/ssl-certificate-problem-certificate-has-expire-in-macos

After fixing the SSL issue, the code installs from source with no problem and I can import Page.