Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #429 (closed defect: fixed)

Opened 20 months ago

Last modified 3 months ago

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

main.py (155 bytes) - added by maggie 20 months ago.
xyz.py (66 bytes) - added by maggie 20 months ago.
test.zip (497 bytes) - added by maggie 20 months ago.
zipped testapplication

Change History

Changed 20 months ago by maggie

Changed 20 months ago by maggie

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),

[...]

Changed 20 months ago by maggie

zipped testapplication

comment:3 Changed 9 months ago by matysek

  • Priority changed from normal to low
  • Milestone set to PyInstaller 2.1

This is not the desired behavior. Verify this ticket with latest dev version.

comment:4 Changed 3 months ago by matysek

  • Status changed from new to closed
  • Resolution set to fixed

Bootloader from latest dev branch uses absolute paths so this is already fixed.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.