For whatever reason, I've never understood the point or actual benefit of virtualenvs.<p>Having lived more in the JS ecosystem for the last several years, my ideal workflow would be a copy of how the Yarn package manager works:<p>- Top-level dependencies defined in an editable metadata file<p>- Transitive dependencies with hashes generated based on the calculated dependency tree<p>- All dependencies installed locally to the project, in the equivalent of a `node_modules` folder<p>- All package tarballs / wheels / etc cached locally and committed in an "offline mirror" folder for easy and consistent installation<p>- Attempting to reinstall packages when they already are installed in that folder should be an almost instantaneous no-op<p>PEP-582 (adding standard handling for a "__pypackages__" folder) appears to be the equivalent of `node_modules` that I've wanted, but tools don't seem to support it yet. I'd looked through several Python packaging tools over the last year, but none of them seemed to support it yet (including Poetry [0]).<p>The only tool that I can find that really supports PEP-582 atm is `pythonloc` [1], which is really just a wrapper around `python` and pip` that adds that folder to the path. Using that and `pip-tools`, I was able to mostly cobble together a workflow that mimics the one I want. I wrote a `requirements.in` file with my main deps, generated a `requirements.txt` with the pinned versions and hashes with `pip-compile`, was able to download and cache them using `pip`, and installed them locally with `piploc`.<p>Admittedly, I've only tried this out once a few weeks ago on an experimental task, but it seemed to work out sufficiently, and I intend to implement that workflow on several of our Python services in the near future.<p>If anyone's got suggestions on better / alternate approaches, I'd be interested.<p>[0] <a href="https://github.com/python-poetry/poetry/issues/872" rel="nofollow">https://github.com/python-poetry/poetry/issues/872</a><p>[1] <a href="https://github.com/cs01/pythonloc" rel="nofollow">https://github.com/cs01/pythonloc</a><p>[2] <a href="https://github.com/jazzband/pip-tools" rel="nofollow">https://github.com/jazzband/pip-tools</a>