简体   繁体   English

使用 pyinstaller 创建的 Python 可执行文件将不再与依赖包一起运行

[英]Python executable created using pyinstaller will no longer run with dependant packages

I have a program written in python that is exported to a raspberry pi to run.我有一个用 python 编写的程序,它被导出到树莓派上运行。 I tested the.py file in the raspberry pi to verify that it works, then used pyinstaller to make a --onefile copy of the.py file as an executable.我在 raspberry pi 中测试了 .py 文件以验证它是否有效,然后使用 pyinstaller 将 .py 文件的 --onefile 副本制作为可执行文件。 When I attempt to run the executable, I get an error that states no module named tkinter.当我尝试运行可执行文件时,我收到一条错误消息,指出没有名为 tkinter 的模块。

ImportError: no module named tkinter

I had problems before using pyinstaller on an x86 computer and trying to port to the raspi, but I compiled on the raspi and avoided that issue, now it just seems like I am not freezing all the packages like it is supposed to.在 x86 计算机上使用 pyinstaller 并尝试移植到 raspi 之前,我遇到了问题,但是我在 raspi 上编译并避免了这个问题,现在看来我并没有像它应该的那样冻结所有包。 To make the executable, I ran the following:为了制作可执行文件,我运行了以下命令:

pyinstaller --onefile bar_3axis.py

Any help would be appreciated.任何帮助,将不胜感激。 Do I need to post complete readout from pyinstaller command?我需要从 pyinstaller 命令发布完整的读数吗?

Well I would like everyone to know it was because my program was written in and supported by python3 packages and I downloaded and was using pyinstaller that used python 2.7 to make the executable.好吧,我想让每个人都知道这是因为我的程序是用 python3 包编写并支持的,我下载并使用了 pyinstaller,它使用 python 2.7 来制作可执行文件。 I uninstalled pyinstaller and redownloaded using pip3 and it worked like a charm.我卸载了 pyinstaller 并使用 pip3 重新下载,它就像一个魅力。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用PyInstaller创建的Python可执行文件无法运行 - Python executable created with PyInstaller doesn't run 我使用pyinstaller创建了python可执行文件,但是执行可执行文件时不存在导入到.py脚本的模块 - I created a python executable by using pyinstaller, but the module imported to my .py script is not present when I execute executable python PyInstaller创建的可执行文件无法运行exe错误:找不到Temp \\\\ _ MEI175682(数据文件) - python PyInstaller created executable failed to run the exe Error: cannot find Temp\\_MEI175682 (data file) 使用 pyinstaller 创建的可执行文件是否需要安装在 PC 上的 Python 和其他模块? - Does executable file created using pyinstaller require Python and other modules installed on PC? 通过 Pyinstaller 创建的 Python 应用程序无法运行 - Python app created via Pyinstaller does not run 如何允许 python 脚本复制使用 pyinstaller 创建的可执行文件? - How to allow python script to replicate the executable file created with pyinstaller? 从Dock中隐藏终端,以获取使用PyInstaller创建的可执行文件 - Hide terminal from dock for an executable created using PyInstaller 通过 PyInstaller 崩溃创建的可执行文件 - Executable created via PyInstaller crashes Python 可通过 pyinstaller 和 Pmw 执行 - Python executable with pyinstaller and Pmw 使用pyinstaller在Linux中创建python可执行文件,无法在Windows计算机上运行 - Creating a python executable in Linux with pyinstaller, fails to run in a Windows machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM