Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于Pyinstaller打包后的exe为什么会报错的解决方案【建议调整一部分代码】 #295

Open
RyanLoil opened this issue Mar 14, 2022 · 0 comments

Comments

@RyanLoil
Copy link

RyanLoil commented Mar 14, 2022

功能描述
建议调整所有os.path.dirname(file)的代码为相对路径

理由
此部分会导致nonebot在pyinstaller打包后的exe中调用如下目录:
C:\Users\[USERNAME]\AppData\Local\Temp\_MEIXXXXXX\
而pyinstaller打包的py文件却在它自己的exe里面,导致[BOTNAME]\plugins等路径无法被找到

实现方案
建议调整所有os.path.dirname(file)的代码为相对路径

另注:
由于plugin写法,需要在pyinstaller生成的[BOTNAME].spec文件中,在hiddenimports里添加所有在插件里的module
还需要将所有的plugins按照开发目录的原始状态拷贝进dist内,一并发布才行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant