- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我用Python 3.6编写了一个程序,我尝试使用Pyinstaller来执行它,但后来我发现Pyinstaller只能工作到Python 3.5,所以我下载了它并尝试执行该文件,但它仍然无法工作!我与它不同的错误找不到文件:
100 INFO: PyInstaller: 3.2.1
100 INFO: Python: 3.6.0
100 INFO: Platform: Windows-10-10.0.14393-SP0
100 INFO: wrote C:\Python\pyi-env-name\Scripts\ATM.spec
100 INFO: UPX is not available.
100 INFO: Extending PYTHONPATH with paths
['F:\\', 'C:\\Python\\pyi-env-name\\Scripts']
100 INFO: checking Analysis
100 INFO: Building Analysis because out00-Analysis.toc is non existent
100 INFO: Initializing module dependency graph...
100 INFO: Initializing module graph hooks...
100 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
File "c:\users\kirsty douglas\appdata\local\programs\python\python36\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\kirsty douglas\appdata\local\programs\python\python36\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python\pyi-env-name\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\__main__.py", line 90, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\__main__.py", line 46, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\python\pyi-env-name\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:\python\pyi-env-name\lib\site-packages\PyInstaller\building\build_main.py", line 734, in build
exec(text, spec_namespace)
File "<string>", line 16, in <module>
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\building\build_main.py", line 212, in __init__
self.__postinit__()
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\building\datastruct.py", line 161, in __postinit__
self.assemble()
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\building\build_main.py", line 317, in assemble
excludes=self.excludes, user_hook_dirs=self.hookspath)
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\depend\analysis.py", line 560, in initialize_modgraph
graph.import_hook(m)
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1509, in import_hook
source_package, target_module_partname, level)
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1661, in _find_head_package
target_module_headname, target_package_name, source_package)
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\depend\analysis.py", line 209, in _safe_import_module
module_basename, module_name, parent_package)
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2077, in _safe_import_module
module_name, file_handle, pathname, metadata)
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2167, in _load_module
self._scan_code(m, co, co_ast)
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2585, in _scan_code
module, module_code_object, is_scanning_imports=False)
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2831, in _scan_bytecode
global_attr_name = get_operation_arg_name()
File "c:\python\pyi-env-name\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2731, in get_operation_arg_name
return module_code_object.co_names[co_names_index]
IndexError: tuple index out of range
我真的不知道还能尝试什么,我已经尝试了我能找到的所有教程,甚至我的老师也不知道发生了什么!
编辑::我刚刚意识到第二行写着
100 INFO: Python: 3.6.0
那么我怎样才能让它使用Python 3.5
最佳答案
(这可能应该是一条评论,但是......代表问题)
您发布的打印输出提到您将其作为 Python 3.6 运行。为了避免这种情况,您可能需要确保您的 PATH 变量仅包含您需要的安装; 3.5.
这至少应该修复您将其作为错误版本的 python 运行的问题。它可能无法解决其他问题。
编辑:Windows 中的环境变量:
关于python - 无法让 Pyinstaller 执行 python 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44137006/
我需要在 pyinstaller“onefile”可执行文件中包含一个 DLL 和一个文本文件。我可以只添加 DLL,但如果我尝试指定这两个文件,pyinstaller 会提示。我宁愿使用命令行选项(
我编写了一个 python 应用程序,它使用 pdfkit 包来打印 PDF。我正在使用 pyinstaller 在 Ubuntu 上构建此应用程序的可执行文件。 pdfkit 依赖于使用 sudo
我想弄清楚为什么 PyInstaller 一直包含 PyQt 的 Windows dll 文件,即使我的应用程序不使用 PyQt。所以,我想知道如何确定 为什么 PyInstaller 认为 PyQt
我在我的 mac osx sierra 下安装了 2 个 python 版本: python 3.5 python 2.7 我用这个命令在python3.5下安装了pyinstaller: pytho
所以,标题基本上涵盖了我的问题。我已经使用 virtualenv 创建了一个项目,例如我必须 source ./env/bin/activate 运行我的脚本。 当我尝试使用以下命令创建可执行文件时:
大约一个月前,我使用 PyInstaller 和 Inno Setup 为我的 Python 3 脚本生成了一个安装程序。我的 AVG Business Edition AntiVirus 刚刚开始提
我正在尝试使用 pyinstaller 制作可执行文件,方法如下: pyinstaller -F --add-binary="sometool.exe:."myapp.py 构建工作正常。但是,如果我
我想要卡住一个 Python 应用程序,作为其功能之一,它能够使用 PyInstaller 生成卡住的 Python 应用程序。这是一个最小的应用程序,显示了我想要实现的目标: import PyIn
运行 pyinstaller myfile.spec 下面的回溯 Traceback (most recent call last): File "/usr/local/bin/pyinstall
首先, native 运行 Fedora 13,PyInstaller 版本为 1.5.1 我在生成规范时确实使用了 --onefile 。 从 Python 解释器中运行“import atexit
我想使用以下命令安装 pyinstaller 模块: pip install pyinstaller 但我总是得到以下错误: 最佳答案 我尝试了一切,但最终我找到了解决方案。 您只需将 pip 从 1
我在 Windows 上运行 Python 3.5.3,并尝试使用 pip 安装 Pyinstaller。它似乎工作 - 没有错误或任何东西,就像 pip 一样非常简单。 我试过 import -m
我已经使用 pyinstaller 在 Windows 10 64 位上从 python 脚本创建了一个 exe。我如何设置 exe 以便它在我的另一台装有 Windows 8 32 位的机器上运行。
我使用以下命令安装了最新版本的 PyInstaller:pip install https://github.com/pyinstaller/pyinstaller/archive/develop.z
我用 python 编写程序来打开路径给出的一些可执行文件。我使用: os.startfile(路径) 启动程序。当我在 IDLE 中运行 script.py 时,它工作正常,但是当我使用 pyins
我在 Python 中构建了一个关键字搜索工具,然后使用 Pyinstaller 将其转换为 .exe 格式,因此我工作场所的人无需安装 Python 即可使用它。 我已通过电子邮件将其以 RAR 文
我遇到了一个问题。我正在使用 pyinstaller 将代码导出到 .exe。代码包括 tkinter、PIL 和 keyboard 模块。软件在我使用 Python 的 PC 上运行完美,而在没有
我正在尝试从我的 python 项目中创建一个可执行文件。我正在使用函数“make_executable”构建可执行文件。 运行添加数据的命令会引发如下错误:pyinstaller: 错误: 无法识别
我想从 .py 创建 .exe 文件。如果我运行 .py 文件,它运行良好,我没有问题。但是当我运行 pyinstaller 创建的 .exe 文件时,我无法在命令行中输入(键入)任何内容。 我已经尝
我有一个小应用程序,我正在尝试针对 Windows 机器构建它。该程序创建一个 OpenVPN 连接。如果我构建程序并运行它,它首先会打开一个控制台作为程序输出。如果我通过 -w pyinstalle
我是一名优秀的程序员,十分优秀!