0

I made a simple program to make bibliographies as none of the online ones have the format I need. In doing this I pip installed 3 dependencies python-docx, kivy and goose3. I packaged the project to an exe using pyinstaller, and when I run the exe, docx seems to work and create a word doc, kivy runs fine but when I try to webscrape, goose3 doesn't work.

I tried giving pyinstaller --paths to where the site packages are, installing the dependencies in the virtualenv but nothing seems to work. I keep getting this error in my exe cmd prompt:

During handling the above exception, another exception occurred:

...

File "C:\Users\prabh\OneDrive\Desktop\bib\dist\bib\my. kv", line 46, in <module>
on_press: root.search()
File "main.py", line 25, in search
article - g.extract(url-u)
File "goose3_init__.py", line 113, in extract
def repr_(self):
File "goose3 __init__.py", line 140, in _crawl
'context': ModuleContext()}
File "goose3\_init__.py", line 127, in crawler_
r_wrapper
if not os.path.exists(path):
File "goose3\crawler.py", line 116, in _init__
File "goose3\crawler.py", line 309, in get_image_extractor
File "goose3\extractors\images.py", line 57, in _init_
File "goose3\extractors\images.py", line 410, in load_customesite_mapping
File "goose3\utils l_init -py", line 46, in loadResourceFile
Only the name of the module followed by "-" is sufficient to activate the
OSError: Couldn't open file C:\Users\prabh\OneDrive\Desktop\bib\dist\bib\goose3\resources images\known-image-css.txt
[68940] Failed to execute script 'main' due to unhandled exception!

There doesn't seem to be a "goose3\resources images" folder in my dist file.

rpanai
  • 12,515
  • 2
  • 42
  • 64
Sen
  • 1

1 Answers1

0

From this article I found that the issue was that PyInstaller wasn't creating the goose3 file in my dist folder.

So, I went to my C:/ drive and found where my IDE (PyCharm) keeps the goose3 folder (usually in user/username/PyCharmProjects/project name/venv/Lib/site-packages/) and simply copy pasted that folder into the dist app folder (dist/app name/)

This fixed the issue.

Sen
  • 1