Comments (3)
Hi, thanks for reporting this issue. As I stated some times in this repository, py2exe is quite a large project with a lot of options, and I am not able to maintain them all as I would like to. Personally, I never used the bundle_files = 1
option, so I cannot tell you right away if that feature is still working in the latest versions.
That being said, I am willing to investigate this bug and perhaps implement a minimal test in the CI /CD chain to retain this functionality. Could you provide me a minimal working code (setup.py
and main Python script) to reproduce this bug?
from py2exe.
Yes, of course. I tried first with a very simple example:
Main.py
import sys
import os
f = open('mylog.log', 'w')
f.write('Hello world')
f.close()
setup.py
from distutils.core import setup
import py2exe
mainfile = r'C:\Main.py'
exefile = 'Main'
setup(name="Main",
version='0.0',
description="Main script",
scripts=[mainfile],
windows=[{"script":mainfile,
'company_name' : "Company (c) 2019",
'copyright' : "Company (c) 2019",
#'uac_info': "requireAdministrator",
'dest_base' : exefile}],
#"icon_resources":[(0, icon_file)]}],
data_files = [],
options={"py2exe": {"unbuffered": True,
"optimize": 2,
"bundle_files": 1,
"compressed": False,
"includes": [],
"excludes" : [],
"packages": [],
"dll_excludes": []},},
zipfile=None)
Until now, we were working with python2 and everything was packeted inside de EXE file using bundle_files=1. That was very convinient for use in order to use a portable instalation. I do not know if this has changed now with newer py2exe versions.
Thanks for replying so fast.
Best regards.
from py2exe.
I think the setting has been changed during the transition to Python 3. Now the setting you are looking for is "bundle_files": 0
. I tested your script and setup files with this option and I can confirm it works as expected. With the option set to 1
, all the dependencies except for external DLLs are embedded in the executable, which is the behavior you were witnessing. The relevant docstrings are here: https://github.com/albertosottile/py2exe/blob/4c524b954183087d7374c79cfd2cd3caadebebf1/py2exe/setup_template.py#L132-L142
It is worth to mention that decreasing the value of bundle_files
can cause more errors when importing several packages. Some of these are caught by the hook systems, others will just fail at execution time.
Since the basic feature is still working as expected, I am closing this issue now. Please feel free to reopen it anytime, if needed.
from py2exe.
Related Issues (20)
- setuptools >= 67: pyparsing has been removed from pkg_resources HOT 4
- freeze module of py2exe does not support building a service anymore HOT 6
- Packages with .libs directories result in don't work HOT 6
- Link on the py2exe wiki page does not go anywhere HOT 2
- Missing LICENSE in wheels HOT 4
- AssertionError with Python embeddable package HOT 1
- Py_OptimizeFlag not set correctly during Python initialization
- OSError: [WinError 87] The parameter is incorrect. HOT 2
- PYTHONPATH module location HOT 1
- Exe is created by doesn't run (opens then closes)
- Simple pygame example tries to lookup files inside of `library.zip` HOT 1
- Support Python 3.12 HOT 23
- Impossible to specify different version info for each of the binaries with the new freeze API. HOT 3
- pynput import break the file HOT 1
- PYTHONIOENCODING is ignored
- pendulum package doesn't initialize when unpacking from zipfile
- add version for python 3.12 too
- usage missing
- Does py2exe support 'QtWebEngineWidgets' of PySide6?
- How do I get an app using jaydebapi to work as an executable ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py2exe.