gpt4 book ai didi

python - (Python) PyInstaller unicode 错误

转载 作者:行者123 更新时间:2023-12-01 04:21:49 25 4
gpt4 key购买 nike

我正在尝试编译一个正在开发的网络爬虫,看看它是否可以在其他系统上正常运行。我正在使用 pyinstaller 3.0。遵循安装说明,安装先决条件,没有错误。

当我尝试使用以下命令编译它时:

pyinstaller wowscrape.py

我收到此 unicode 错误:

...
File "C:\Users\brian_000\Documents\GitHubVisualStudio\wowscrape\wowscrape\wowscrape\wowscrape.py" line 1
\ufeffimport os
^
SyntaxError: invalid character in identifier

我在 unicode 和 pyinstaller 上能找到的唯一东西就是在 Linux 上安装它。

我仔细研究了构建文件夹,注意到“base_library”rar 中有 unicode 的处理程序,所以我不确定它卡在什么地方。

我使用的是 Python 3.4,在这个项目中我有:

os
sys
urllib
bs4
pyqt5
loginwindow << is an import from qt designer converted to python
mainwindow << is an import from qt designer converted to python

如果没有办法让它与 pyinstaller 一起工作,还有其他选择吗?我还没有看到太多支持将 Python 3 打包到具有跨系统支持的 exe 中。由于它是一个基于 WoW 的抓取工具,我希望它能够为 Win/Mac/Nix 生成应用程序。

提前谢谢您。

这是我正在尝试构建的主要脚本,如果有帮助的话。我知道,它又乱又长。它仍在原型(prototype)设计中。 link to code

最佳答案

将文件保存在编码为 UTF-8 且不带字节顺序标记 (BOM) 的编辑器中,然后重试。一个像样的编辑器应该有一个菜单条目,例如文件-->使用编码保存

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

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