pyinstaller

pyinstaller: adding dynamically loaded modules

非 Y 不嫁゛ 提交于 2021-02-07 21:11:55
问题 I'm trying to use Pyinstaller to bundle a server written in Python3. Part of the server code was written in a way that some modules are dynamically loaded like this: mod_files = [f for f in os.listdir(path)]: for f in mod_files: mod = importlib.import_module(mod_name) How do I handle these files with Pyinstaller? 回答1: Pyinstaller (currently v 3.4) can't detect imports like importlib.import_module() . The issue and solutions are detailed in Pyinstaller's documentation, which I pasted below as

pyinstaller: adding dynamically loaded modules

六眼飞鱼酱① 提交于 2021-02-07 21:10:57
问题 I'm trying to use Pyinstaller to bundle a server written in Python3. Part of the server code was written in a way that some modules are dynamically loaded like this: mod_files = [f for f in os.listdir(path)]: for f in mod_files: mod = importlib.import_module(mod_name) How do I handle these files with Pyinstaller? 回答1: Pyinstaller (currently v 3.4) can't detect imports like importlib.import_module() . The issue and solutions are detailed in Pyinstaller's documentation, which I pasted below as

PyInstaller .exe file does nothing

此生再无相见时 提交于 2021-02-07 06:24:14
问题 After 3 days, I can't get a python program packaged into a .exe file. I've tried py2exe (which continuously missed modules), and PyInstaller. Here's the complicated part. My program uses a lot of additional installed modules (coopr, pyomo, openpyxl, glpk, cbc, pyutilib, numpy, etc.). These in turn import all kinds of other things, and I can't track it down (the PyInstaller warning log lists 676 lines of missing or potentially unneeded modules.) However, I've gotten (by adding imports of

PyInstaller .exe file does nothing

会有一股神秘感。 提交于 2021-02-07 06:23:09
问题 After 3 days, I can't get a python program packaged into a .exe file. I've tried py2exe (which continuously missed modules), and PyInstaller. Here's the complicated part. My program uses a lot of additional installed modules (coopr, pyomo, openpyxl, glpk, cbc, pyutilib, numpy, etc.). These in turn import all kinds of other things, and I can't track it down (the PyInstaller warning log lists 676 lines of missing or potentially unneeded modules.) However, I've gotten (by adding imports of

PyInstaller ImportError: No module named 'pyfiglet.fonts'

跟風遠走 提交于 2021-02-07 04:01:26
问题 I'm attempting to use PyInstaller to compile one of the demo scripts for Asciimatics, in hopes to eventually be able to create a simple GUI for a text-based game I'm developing, and it returns the following error: C:\Users\X\Documents\Python Scripts\asciimatics samples\dist\test>test.exe Traceback (most recent call last): File "site-packages\setuptools-19.2-py3.4.egg\pkg_resources\__init__.py", line 443, in get_provider KeyError: 'pyfiglet.fonts' During handling of the above exception,

PyInstaller ImportError: No module named 'pyfiglet.fonts'

感情迁移 提交于 2021-02-07 04:00:19
问题 I'm attempting to use PyInstaller to compile one of the demo scripts for Asciimatics, in hopes to eventually be able to create a simple GUI for a text-based game I'm developing, and it returns the following error: C:\Users\X\Documents\Python Scripts\asciimatics samples\dist\test>test.exe Traceback (most recent call last): File "site-packages\setuptools-19.2-py3.4.egg\pkg_resources\__init__.py", line 443, in get_provider KeyError: 'pyfiglet.fonts' During handling of the above exception,

PyInstaller ImportError: No module named 'pyfiglet.fonts'

帅比萌擦擦* 提交于 2021-02-07 03:59:34
问题 I'm attempting to use PyInstaller to compile one of the demo scripts for Asciimatics, in hopes to eventually be able to create a simple GUI for a text-based game I'm developing, and it returns the following error: C:\Users\X\Documents\Python Scripts\asciimatics samples\dist\test>test.exe Traceback (most recent call last): File "site-packages\setuptools-19.2-py3.4.egg\pkg_resources\__init__.py", line 443, in get_provider KeyError: 'pyfiglet.fonts' During handling of the above exception,

.app made using PyInstaller closes straight away?

北城余情 提交于 2021-02-06 11:20:27
问题 I have attempted to convert my python program into a .app using PyInstaller. The actual code runs fine through IDLE, but everytime I try and run the newly converted .app, it closes straight away. Below is my .spec file and my .py file. I have edited the .spec file, adding in the text file I import in my .py file. PYTHON FILE: #CENTRALCOAST: 2250-2420 #CENTRALCOAST2: 2250-2267 #NORTHERNBEACHES: 2084-2108 CentralCoast = [] NorthernBeaches = [] OOR = [] Invalid = [] import math def numLen(num):

.app made using PyInstaller closes straight away?

怎甘沉沦 提交于 2021-02-06 11:19:41
问题 I have attempted to convert my python program into a .app using PyInstaller. The actual code runs fine through IDLE, but everytime I try and run the newly converted .app, it closes straight away. Below is my .spec file and my .py file. I have edited the .spec file, adding in the text file I import in my .py file. PYTHON FILE: #CENTRALCOAST: 2250-2420 #CENTRALCOAST2: 2250-2267 #NORTHERNBEACHES: 2084-2108 CentralCoast = [] NorthernBeaches = [] OOR = [] Invalid = [] import math def numLen(num):

Pyinstaller with relative imports

蹲街弑〆低调 提交于 2021-02-06 10:49:40
问题 I'm attempting to make a Pyinstaller build for Windows 7 using Pyinstaller 2.1. The module uses relative imports because the package is typically used in Linux as a 'regular' Python package. Is there a way to create a spec file to handle this type of setup? Ideally I would like to have a Python package that I can make a Pyinstaller exe with for Windows and have a 'regular' pip-installable Python package in Linux/OS X. I was thinking of maybe using hidden imports or something to achieve this.