我做了一个简单的程序来制作参考书目,因为没有一个在线的书目有我需要的格式。为此,我 pip 安装了 3 个依赖项 python-docx、kivy 和 goose3。我使用pyinstaller将项目打包为exe,当我运行exe时,docx似乎可以工作并创建一个word doc,kivy运行良好但是当我尝试webscrape时,goose3不起作用。
我尝试将 pyinstaller --paths 提供给站点包所在的位置,在 virtualenv 中安装依赖项,但似乎没有任何效果。我在我的 exe cmd 提示符中不断收到此错误:
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!
我的 dist 文件中似乎没有“goose3\resources images”文件夹。