I have a script to grab a daily featured wikipedia article as text.
But the version of the package it depends on to parse the feed (feedparser) no longer works in G3.
When I installed the latest version of it and simply dragged it into the Glyphs App /Scripts, there’s missing dependencies. If I try to import the same package in my shell python environment, it works. How do I install it correctly?
The easiest solution is probably to install a custom python version (brew or from python.org). Then you can use its pip to install whatever you need.
The Glyphs python might contain pip, too (I never checked). If you call it directly and figure out a way to give it a path outside of the Glyphs Python module …
I see… when I try to use a custom Python version, I get that error that says every single one of my plugins crashed. I’ll try again in debug mode and see how things work
I’ve tried directly installing feedparser via pip inside the glyphs python, got this instead
Traceback (most recent call last):
File "Get Random Featured Article of the Day.py", line 14
html = d['entries'][randint(0,len(d['entries'])-1)]['summary_detail']['value']
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "random.py", line 362, in randint
return self.randrange(a, b+1)
^^^^^^^^^^^^^^^^^^^^^^
File "random.py", line 345, in randrange
raise ValueError("empty range for randrange() (%d, %d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (0, 0, 0)