-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frozen programs require the original build directory in order to run. #57220
Comments
In Python 2.7.2, Linux executables built with freeze.py 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:
$ tar -xf Python-2.7.2.tar.bz2
$ cd Python-2.7.2
$ ./configure --prefix=`pwd`/install
$ make
$ make install
$ echo 'print "Hello World"' >hello.py
$ ~/src/Python-2.7.2/python ~/src/Python-2.7.2/Tools/freeze/freeze.py hello.py
$ 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/site.py", line 563, in <module>
File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 545, in main
File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 278, in addusersitepackages
File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 253, in getusersitepackages
File "/home/malcolmp/src/Python-2.7.2/Lib/site.py", line 243, in getuserbase
File "/home/malcolmp/src/Python-2.7.2/Lib/sysconfig.py", line 520, in get_config_var
File "/home/malcolmp/src/Python-2.7.2/Lib/sysconfig.py", line 419, in get_config_vars
File "/home/malcolmp/src/Python-2.7.2/Lib/sysconfig.py", 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) |
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? |
This seems very outdated, can we close it? |
Closing, please reopen or create a new issue if this is still a problem after all these years. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: