question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Portable Xcopy-able Venvs

See original GitHub issue

How would this feature be useful?

  • Ability to attach docker volumes (dir paths) directly to a running or “stock” docker image.
  • Ability to archive, ship, and reuse/restore virtual environment directories across environments.
  • Ability to dynamically compose complex environments from static/precompiled pipx package archives.

Describe the solution you’d like

If don’t know if there would be technical blockers for this, but the idea would be:

On Machine A:

pipx install my-tool
pipx export my-tool ./my-tool.tar.gz

On Machine B:

pipx import ./my-tool.tar.gz

And similarly, when attached to a docker container:

myhost$ unzip ./my-tool.tar.gz ./my-tool
myhost$ docker run --it -v ./my-tool:/pipx/portable/my-tool pipx:py3.8
docker$ pipx load-from /pipx/portable
docker$ my-tool --version

Describe alternatives you’ve considered

From within a Dockerfile, you can copy directories across composite images, but I have not fully tested this and I don’t have a universal/portable way to ensure shims are properly installed/updated when copying from one image/machine to another.

Challenges anticipated:

  1. Shims won’t get copied over with the virtual env directory - they’d probably need to be re-initialized/refreshed by an explicit pipx command.
  2. There may be limitations in portability based on (1) the version of python and (2) the platform and version of the host OS.

I think even if we mandate same python version and same core OS platform, this could have very high value in making compatible docker images composable.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, Apr 24, 2021

I don’t have much experience to pex, but zipapp is a very established mechanism that is known to work (pip internally uses it as well). Shiv is a similar tool built on zipapp.

There are some gochas to zipapp if a module is poorly implemented. Those issues are fortunately increasingly rare, and you can always patch them when necessary (since the zipapp veondors all the libraries by definition anyway). I would highly encourage you trying it out.

0reactions
aaronsteerscommented, Apr 26, 2021

Thanks, @uranusjr! I’ll check it out! 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipx - Bountysource
I'm currently trying to install pipx within my windows machine, and it seems that is not able to detect my path environmental variables...
Read more >
Level Showcase - LBPCentral Archive
Venus Valley! (1 Player Only!) ... Sackbot X - COPYABLE LEVEL TOOLS! ... RX-78 Mobile Suit Gundam by dr-booty, 1, dr-booty, 2011-06-17 23:19:00....
Read more >
pipx - bytemeta
Portable Xcopy-able Venvs. itsayellow. itsayellow CLOSED · Updated 1 year ago · Other `pipx list` output formats. mmozos. mmozos CLOSED · Updated 1...
Read more >
Untitled
Select Katalon Studio Preferences > Katalon > Mobile. ... look at the other solutions: is:issue "DLL required for this install" Also node is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found