Pipx-based meta-installer

24 views
Skip to first unread message

Paul Prescod

unread,
Dec 11, 2020, 10:18:54 AM12/11/20
to PyInstaller
Thanks to everyone who works on pyinstaller!

The installation instructions for a package I work with are:

 * install Python
 * install Pipx
 * pipx install package

So I had the idea that all 3 steps could be combined into a single executable that just does this:

    from pipx import main

    parser = main.get_command_parser()
    args = parser.parse_args(args=["install", "someprogram"])

    main.run_pipx_command(args)

I went this route rather than directly packaging my app because I thought that the process of debugging it would have value to the entire PIP ecosystem rather than just my (also rather complicated) app.

It builds, but unfortunately, it fails on run.

  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "/Users/pprescod/.venvs/CCI-38/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
    exec(bytecode, module.__dict__)
  File "pipx/venv.py", line 27, in <module>
  File "pkgutil.py", line 637, in get_data
  File "/Users/pprescod/.venvs/CCI-38/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 341, in get_data
    with open(path, 'rb') as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/pprescod/code/installer/dist/foo/pipx/venv_metadata_inspector.py'
[67243] Failed to execute script foo

Has anyone tried this? Is the problem obvious?

 - Paul

bwoodsend

unread,
Dec 12, 2020, 5:56:45 AM12/12/20
to PyInstaller
You're never going to run anything pip related from a PyInstaller app - I can think of a whole list of components which pip needs but PyInstaller intentionally strips down.

Paul Prescod

unread,
Dec 14, 2020, 3:39:32 AM12/14/20
to pyins...@googlegroups.com
Thanks for the reality check!

On Sat, Dec 12, 2020 at 2:56 AM bwoodsend <bwoo...@gmail.com> wrote:
You're never going to run anything pip related from a PyInstaller app - I can think of a whole list of components which pip needs but PyInstaller intentionally strips down.

--
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 pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/f392a938-5953-4f3b-a65a-b4b28ebe54b2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages