Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带有py2exe或pyinstaller的Python脚本可执行文件_Python_Py2exe_Pyinstaller - Fatal编程技术网

带有py2exe或pyinstaller的Python脚本可执行文件

带有py2exe或pyinstaller的Python脚本可执行文件,python,py2exe,pyinstaller,Python,Py2exe,Pyinstaller,我的程序包含3个文件(2x.py和.json)。我想制作一个exe文件。我使用基本设置尝试了py2exe: from distutils.core import setup import py2exe setup(console = ['my_main_file.py']) 它不起作用。当我从dist目录运行exe文件时,终端窗口会闪烁一秒钟。我也试过pyinstller,但结果相似。我怎样才能做到呢?我解决了!我从终端启动了我的.exe文件,收到一个错误“没有文件myfile.json”或

我的程序包含3个文件(2x.py和.json)。我想制作一个exe文件。我使用基本设置尝试了py2exe:

from distutils.core import setup
import py2exe

setup(console = ['my_main_file.py'])

它不起作用。当我从dist目录运行exe文件时,终端窗口会闪烁一秒钟。我也试过pyinstller,但结果相似。我怎样才能做到呢?

我解决了!我从终端启动了我的.exe文件,收到一个错误“没有文件myfile.json”或类似的错误。我只是把这个文件复制到光盘目录,程序就可以运行了。

我解决了它!我从终端启动了我的.exe文件,收到一个错误“没有文件myfile.json”或类似的错误。我只是把这个文件复制到光盘目录,程序就可以运行了。

你运行的是什么版本的python?python 2.7.10,Windows 10 64位。在过去,我制作了一个简单的脚本可执行,但它只运行了1个文件。您运行的是什么版本的python?python 2.7.10,Windows 10 64位。在过去,我使简单的脚本可执行,它的工作,但它只有一个文件。