pyinstaller

pyinstaller .exe works locally but fails when called by C#?

霸气de小男生 提交于 2020-03-05 03:19:52
问题 I have created a script using Python2.7 and compiled it using pyinstaller into an exe of the same name, in this case "GeneralStats.py" turns into "GeneralStats.exe" using --onefile and -w arguments. When called with C# I use: var pythonDirectory = (Directory.GetCurrentDirectory()); var filePathExe1 = Path.Combine(pythonDirectory + "\\Python\\GeneralStats.exe"); Process.Start(filePathExe1); When called outside of C#, so in my local files I can run the .exe and the result is a text file with

pyinstaller打包的程序无法执行,提示Operation not permitted解决

此生再无相见时 提交于 2020-03-03 14:58:44
前言 PyInstaller 是一个强大的工具,它可以分析我们的python脚本,发现脚本执行所依赖的模块,并将他们打包到一个文件夹,或者封装成一个可执行文件(exe或者binary)。然后,我们就可以将这个文件(文件夹)放到其他机器上去执行,目标机器甚至可以不用安装python环境!这跟 docker 有异曲同工之妙。 问题描述 在 Centos7 上,用 PyInstaller 将 py 文件打成一个binary,把该可执行文件放到其他的 Centos7 上去执行,结果报如下的错误: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted 问题定位 一般 Operation not permitted 都是权限不足导致的,但是看了一下文件,是有 执行 (x)的权限的。 把这个文件放到其他的机器上去执行,发现有的机器可以跑,有的机器不能跑!所以肯定是机器配置上的差异。 回到 PyInstaller 官网,看到如下介绍: The bootloader is the heart of the one-file bundle also. When started it creates a temporary

ModuleNotFound error while executing a package created by PyInstaller On Windows

时光毁灭记忆、已成空白 提交于 2020-03-03 11:45:25
问题 I am packaging my ML solution which includes keras and tensorflow using PyInstaller. The exe builts just fine but when I execute the exe it gives an ModuleNotFoundError for boto . The solution works just fine if I run it using the script. All the dependencies were installed. Here is my spec file: block_cipher = None a = Analysis(['main.py'], pathex=['.'], binaries=[], datas=[('data\\*.tsv', 'data')], hiddenimports=['sklearn.neighbors.typedefs','sklearn.neighbors.quad_tree','sklearn.tree.

ModuleNotFound error while executing a package created by PyInstaller On Windows

前提是你 提交于 2020-03-03 11:44:30
问题 I am packaging my ML solution which includes keras and tensorflow using PyInstaller. The exe builts just fine but when I execute the exe it gives an ModuleNotFoundError for boto . The solution works just fine if I run it using the script. All the dependencies were installed. Here is my spec file: block_cipher = None a = Analysis(['main.py'], pathex=['.'], binaries=[], datas=[('data\\*.tsv', 'data')], hiddenimports=['sklearn.neighbors.typedefs','sklearn.neighbors.quad_tree','sklearn.tree.

Cannot find output folder for .exe file using pyinstaller

妖精的绣舞 提交于 2020-03-03 07:58:13
问题 I am completely new to python and trying to create an application (or .exe) file for python using pyinstaller. I ran the command pyinstaller -[DIRECTORY].py and it saved it to an output directory "C:\Windows\System32\Dist\Foo", however when i tried to locate the directory it did not seem to exist (Dist). NOTE: i'm trying to convert a .py file to .exe file in Python 3.5 Thanks for any help :) 回答1: If you set your command directory to the .py script location and run pyinstaller yourscript.py ,

PyInstaller newbie: hello world

落爺英雄遲暮 提交于 2020-03-01 06:46:27
问题 I'm trying to use PyInstaller v2.1 to create a single executable out of a simple hello world script (Python 2.7). The script, hello.py, has just one line: print 'Hello, World!' I then open a command window in the folder containing the script and enter: pyinstaller -F hello.py I get the following output: C:\Users\chris\workspace\HelloPy>pyinstaller -F hello.py 43 INFO: wrote C:\Users\chris\workspace\HelloPy\hello.spec 66 INFO: Testing for ability to set icons, version resources... 79 INFO: ...

python程序打包

我是研究僧i 提交于 2020-02-28 09:25:54
pyinstaller demo.py -w 去除windows控制台窗口 -F 打包只有一个exe程序 -i xx.ico 程序icon图标 -p 不在python目录第三方库 来源: oschina 链接: https://my.oschina.net/oisanblog/blog/3157630

pyinstaller 打包exe运行错误 No module named 'pkg_resources.py2_warn'

非 Y 不嫁゛ 提交于 2020-02-26 18:47:40
背景: 使用pyinstaller打包好exe后,运行出现以下错误。在更新pip的python库前打包是可以正常运行的。 打包过程没有出现任何错误提示。环境python3.7.4 win64 Traceback (most recent call last): File "site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 13, in <module> File "c:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_ importers.py", line 623, in exec_module exec(bytecode, module.__dict__) File "site-packages\pkg_resources\__init__.py", line 86, in <module> ModuleNotFoundError: No module named 'pkg_resources.py2_warn' [3844] Failed to execute script pyi_rth_pkgres 解决方法: 我的方法是:找到 \Python37\Lib\site-packages\pkg

Pyinstaller Jinja2 TemplateNotFound

余生颓废 提交于 2020-02-23 09:03:08
问题 I am using pyinstaller to build my flask application, everything is working fine except I get problems with Jinja2 templates. It gave me jinja2.exceptions.TemplateNotFound , I tried to put from app import template which is the templates folder, but it didn't work (I guess since they don't contain any py file). I also tried changing the .spec file to include the templates folder added_files = [ ( '..\\CommerceApp\\app\\templates', 'templates' ), ( '..\\CommerceApp\\app\\static', 'static' ) ] a

Include multiple data files with pyinstaller

元气小坏坏 提交于 2020-02-22 07:27:06
问题 I need to include a DLL AND a text file in a pyinstaller "onefile" executable. I can add just the DLL but if I try to specify both files, pyinstaller complains. I would rather use the command line options (rather than the spec file) - what's the correct format for multiple files? http://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-data-files http://pyinstaller.readthedocs.io/en/stable/usage.html#options-group-what-to-bundle-where-to-search Tried a few things, e.g. pyinstaller: