gpt4 book ai didi

python - Windows 上的 PyInstaller 错误

转载 作者:可可西里 更新时间:2023-11-01 10:33:06 27 4
gpt4 key购买 nike

我正在尝试在 Windows 上使用 PyInstaller 编译一些脚本。

该脚本使用 PySide 和 OpenPyXL 库。我使用 PIP(PySide、OpenPyXL、PEFILE 和 PyInstaller)安装了所有依赖项。

我的脚本使用任何 unicode 字符,但是当我尝试执行 PyInstaller 时它显示下一个回溯错误:

Traceback (most recent call last):
File "C:\Python27\Scripts\pyinstaller-script.py", line 11, in <module>
load_entry_point('PyInstaller==3.2.1', 'console_scripts', 'pyinstaller')()
File "c:\python27\lib\site-packages\PyInstaller\__main__.py", line 90, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\python27\lib\site-packages\PyInstaller\__main__.py", line 46, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", line 788, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", line 734, in build
exec(text, spec_namespace)
File "<string>", line 33, in <module>
File "c:\python27\lib\site-packages\PyInstaller\building\api.py", line 650, in __init__
self.__postinit__()
File "c:\python27\lib\site-packages\PyInstaller\building\datastruct.py", line 161, in __postinit__
self.assemble()
File "c:\python27\lib\site-packages\PyInstaller\building\api.py", line 682, in assemble
dist_nm=inm)
File "c:\python27\lib\site-packages\PyInstaller\building\utils.py", line 190, in checkCache
cachedfile = os.path.join(cachedir, basenm)
File "c:\python27\lib\ntpath.py", line 86, in join
result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 16: ordinal not in range(128)

脚本路径为"C:\extractorcfdi\extratorcfdi.pyw"

我的 Python 版本是 2.7.13 for x86。

最佳答案

我遇到了同样的问题,这显然是由我的 (Windows 7) 用户名​​包含“ñ”字符引起的。我的解决方法是在具有管理员权限的 Windows 中创建第二个用户名,我可以从中生成可执行文件而不会出现任何错误。

关于python - Windows 上的 PyInstaller 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42959677/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com