4 ms·
> Ensures you have the same python environment. But not the same Python runtime, which does not fulfil the request of guaranteeing it works the same later with
by latexr 3y ago
> Ensures you have the same python environment.
But not the same Python runtime, which does not fulfil the request of guaranteeing it works the same later without asterisks.
- scaryclam 3y agoI'm not sure what you might mean by runtime, but a python venv does make sure you're using the same runtime. There are symlinks in the environments bin directory to the specific runtime. If you're plonking a python3.12 binary over the top of the python3.11 one, then yeah, you'll be using a different one, but that'd be an issue nomatter what you're using. Just don't uninstall your python binaries and you're fine. If you want to package everything up into am image or a zip, you can do that too if you want, but in my 10+ year career I've not had much of an issue just using boring venvs.
- adolph 3y agoIf you attempt to reproduce a project in a repo that only includes source and requirements.txt you will not have metadata about the version of Python used. It seems that there is a way to do this in pip but I don’t think it is widely used: https://stackoverflow.com/questions/19559247/requirements-txt-depending-on-python-version https://stackoverflow.com/questions/19559247/requirements-tx...
- latexr 3y ago> but a python venv does make sure you're using the same runtime. It does not. > There are symlinks in the environments bin directory to the specific runtime. Precisely. They symlink to a path. Which means that if you have a certain version of Python at one location (let’s say /usr/bin/python3) and later update that (let’s say by upgrading macOS and the Xcode developer tools), the same virtual environment will point to a different version of Python. > Just don't uninstall your python binaries and you're fine. That’s not a practical solution. Sometimes you don’t have a choice, as demonstrated above. By that logic one could say “don’t change anything about your system and you don’t even need virtual environments”. Which is somewhat true, but also profoundly unhelpful. The point of the question was to reproduce the same thing without asterisks and you’ve introduced a major one and called it a day.
- camgunz 3y agoYou can use --copies if you don't want symlinks [0]. [0]: https://docs.python.org/3/library/venv.html https://docs.python.org/3/library/venv.html
- latexr 3y agoNot with the macOS Python from the Xcode developer tools: > Error: This build of python cannot create venvs without using symlinks
- camgunz 3y agoDon't use that one
- latexr 3y ago— Doctor, it hurts when I raise may arm. — Then don’t raise your arm. Like I said in the original comment you replied to and are now ignoring: > That’s not a practical solution. Sometimes you don’t have a choice, as demonstrated above. By that logic one could say “don’t change anything about your system and you don’t even need virtual environments”. Which is somewhat true, but also profoundly unhelpful.
- scaryclam 3y agoThis is more like: - Doctor, it hurts when I hit my head on the wall - Then don't hit your head on the wall You have solutions available, use them
- latexr 3y agoApparently, “sometimes you don’t have a choice” is a foreign language. — Hey, so you know how we have this requirement, which came about after years of dealing with and understanding a problem and the available solutions? — Yes, what about it? — Well, a random commenter on Hacker News who has zero context of the problem has suggested we use a method we already found inadequate for our specific use case. — Oh wow, in that case let’s replace the whole system right now.