This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Frozen programs require the original build directory in order to run.
Type: behavior Stage: resolved
Components: Demos and Tools Versions: Python 2.7
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, iritkatriel, malcolmp
Priority: normal Keywords:

Created on 2011-09-20 01:44 by malcolmp, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg144315 - (view) Author: Malcolm Purvis (malcolmp) Date: 2011-09-20 01:44
In Python 2.7.2, Linux executables built with will only run on the machine that contains the original build directory.  This defeats the purpose of having frozen programs.  This problem did not exist in Python 2.5.

The following steps reproduce the problem:

1) Build a copy of python:

$ tar -xf Python-2.7.2.tar.bz2
$ cd Python-2.7.2
$ ./configure --prefix=`pwd`/install
$ make
$ make install

2) In another directory, build a frozen program:

$ echo 'print "Hello World"' >
$ ~/src/Python-2.7.2/python ~/src/Python-2.7.2/Tools/freeze/
$ make
$  ./hello 
Hello World

Copy the binary to another machine:

$ $ ./hello 
Traceback (most recent call last):
  File "/home/malcolmp/src/Python-2.7.2/Lib/", line 563, in <module>
  File "/home/malcolmp/src/Python-2.7.2/Lib/", line 545, in main
  File "/home/malcolmp/src/Python-2.7.2/Lib/", line 278, in addusersitepackages
  File "/home/malcolmp/src/Python-2.7.2/Lib/", line 253, in getusersitepackages
  File "/home/malcolmp/src/Python-2.7.2/Lib/", line 243, in getuserbase
  File "/home/malcolmp/src/Python-2.7.2/Lib/", line 520, in get_config_var
  File "/home/malcolmp/src/Python-2.7.2/Lib/", line 419, in get_config_vars
  File "/home/malcolmp/src/Python-2.7.2/Lib/", line 287, in _init_posix
IOError: invalid Python installation: unable to open /home/malcolmp/src/Python-2.7.2/install/lib/python2.7/config/Makefile (No such file or directory)
msg145718 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-17 15:53
Thanks for the report.  In 2.7 and 3.2, Python initialization was changed to use the new sysconfig module, which depends on the sysconfig.cfg file.  freeze needs to special-case the sysconfig module in its detection code to include the cfg file.

Do you want to work on a patch?
msg411532 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-24 23:48
This seems very outdated, can we close it?
msg415862 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-03-23 10:10
Closing, please reopen or create a new issue if this is still a problem after all these years.
Date User Action Args
2022-04-11 14:57:21adminsetgithub: 57220
2022-03-23 10:10:40iritkatrielsetstatus: pending -> closed

messages: + msg415862
stage: needs patch -> resolved
2022-01-24 23:48:19iritkatrielsetstatus: open -> pending

nosy: + iritkatriel
messages: + msg411532

resolution: out of date
2011-10-17 15:53:35eric.araujosetnosy: + eric.araujo

messages: + msg145718
stage: needs patch
2011-09-20 01:44:50malcolmpcreate