I asked why, on Ubuntu, the boot loader of a one-dir bundle is failing with
"No such file or directory: ...orig-prefix.txt' (the full traceback is
below).
I have investigated further. I omitted to mention that I was running
Python3 and PyInstaller, in a virtual environment.
It turns out that orig-prefix.txt is a file that virtualenv creates and
stores in the lib/ directory of the VENV.
In Pyinstaller/build_app.py it is mentioned twice. Once in get_runtime()
and later with almost identical code, in create_binaries(). In both cases
its contents are used to get the path prefix to find the Python interpreter.
So why is it also being referenced from the bootloader? It turns out that
the bootloader is loading what it thinks are needed built-in modules. In
pyi_importers.load_module(), it is loading something called "site.py".
The site.py in my VENV starts out, literally like the 5th statement
executed, with
f = open(os.path.join(os.path.dirname(__file__), 'orig-prefix.txt'))
However, it is not running in a VENV, it is running in a one-dir (or a
one-file, same problem) PyInstaller bundle. The virtualenv is long gone. So
there is no file orig-prefix.txt.
Can anyone help me understand what is going on and how to fix this?
Thanks,
Dave Cortesi
Ubuntu 14.10
> Python 3
> The Python3 branch of PyInstaller
> Create a one-dir version of a PyQt5 app.
> On startup it fails with:
>
> Traceback (most recent call last):
> File "<string>", line 86, in <module>
> File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
> File "<frozen importlib._bootstrap>", line 2226, in
> _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
> File "<frozen importlib._bootstrap>", line 1161, in
> _load_backward_compatible
> File
> "/home/dcortesi/VENV3/lib/python3.4/site-packages/PyInstaller-3.0dev-py3.4.egg/PyInstaller/loader/pyi_importers.py",
> line 302, in load_module
> exec(bytecode, module.__dict__)
> File "/home/dcortesi/VENV3/lib/python3.4/site.py", line 703, in <module>
> main()
> File "/home/dcortesi/VENV3/lib/python3.4/site.py", line 670, in main
> virtual_install_main_packages()
> File "/home/dcortesi/VENV3/lib/python3.4/site.py", line 553, in
> virtual_install_main_packages
> f = open(os.path.join(os.path.dirname(__file__), 'orig-prefix.txt'))
> FileNotFoundError: [Errno 2] No such file or directory:
> '/home/dcortesi/VENV3/pyinstaller/dist/PPQT2/orig-prefix.txt'
>
>
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.