首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当我尝试打包我的python项目时,exe不工作,因为我怀疑依赖项没有打包

当我尝试打包我的python项目时,exe不工作,因为我怀疑依赖项没有打包
EN

Stack Overflow用户
提问于 2021-11-20 01:41:21
回答 1查看 21关注 0票数 0

我做了一个简单的程序来制作书目,因为没有一个在线书目有我需要的格式。为了做到这一点,我安装了3个依赖python-docx,kivy和goose3。我使用pyinstaller将项目打包成一个可执行文件,当我运行可执行文件时,docx似乎可以工作并创建一个word文档,kivy运行得很好,但当我尝试webscrape时,goose3不能工作。

我尝试给pyinstaller提供站点包所在位置的路径,在virtualenv中安装依赖项,但似乎都不起作用。我在exe cmd提示符中不断收到以下错误:

代码语言:javascript
复制
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“文件夹。

EN

回答 1

Stack Overflow用户

发布于 2021-11-20 03:15:04

this article中我发现问题出在PyInstaller没有在我的dist文件夹中创建goose3文件。

所以,我转到我的C:/驱动器,找到了我的集成开发环境(PyCharm)保存goose3文件夹的位置(通常在user/username/PyCharmProjects/项目名称/venv/Lib/site-packages/),然后简单地将该文件夹复制粘贴到dist应用程序文件夹(dist/app name/)

这解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70042626

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档