Ticket #429 (closed defect: fixed)
pyinstaller executable is dependent of working directory
| Reported by: | maggie | Owned by: | matysek |
|---|---|---|---|
| Priority: | low | Milestone: | PyInstaller 2.1 |
| Component: | PyInstaller | Version: | 1.5.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Hi,
im having a strange behaviour with an executable created with pyinstaller (r1556).
I'm developing an application on a personal folder on my pc. The created executable is containing a file named "xyz.py" located in subfolder (package) "a". I introspected outPYZ1.pyz with archiveviewer and found xyz.pyz of package a included.
When i creat a new working version of the application im copying the whole folder structure (including all sources) to an other place to make it available to others.
Recently i only copied the generated executable. As i wanted to execute it from this place i got an error in my application which concerned the earlier version of the programm.
So i tried the following: i copied the new "xyz.py" in subfolder "a" of the outer place. And tada, it works. I replaced it again with the old version: its not working again.
So the executable is using the source file instead of the packaged file?
Is this the desired behaviour ?
Attachments
Change History
comment:1 Changed 20 months ago by maggie
I attached a test application.
Locate xyz.py in a subfolder "a" and create a init.py in the same folder. Place the main.py in the root directory.
Build commands were (ran in pyinstaller\utils):
Makespec.py -F -n test -o ..\..\sonstiges\test_use_package\exe ..\..\sonstiges\test_use_package\main.py Build.py ..\..\sonstiges\test_use_package\exe\test.spec
If you change the argument of print in xyz.py and place the generated executable in the same location as main.py, the .exe will output the contents of xyz.py.
comment:2 Changed 20 months ago by maggie
ArchiveViewer?.py ...outPYZ1.pyz results in:
[...]
'_threading_local': (False, 202773L, 2572), 'a': (True, 538801L, 120), 'a.xyz': (False, 252537L, 183), 'abc': (False, 158660L, 2447),
[...]
