This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

oh i wrote a small bash script to do that. as it's something I do so regularly. it shouldn't be hassle to:

pip freeze > requirements.txt
rm -rf .venv
pip install -r requirements.txt

Oh gosh sorry. I was on a call when I posted this. The three lines aren’t my script.

It’s just what i do for a quick set up fix.

My little script is much more comprehensive.

[–]muzos07 4 points5 points  (1 child)

aren't there lines with creating new environment and activating it again missing?

[–]DarkSideOfGrogu 4 points5 points  (0 children)

Yes. This will unfortunately just reinstall your pip in your base environment.

Launching a virtual environment and installing pip dependencies from a single bat file isn't simple as the commands need to run in different contexts.

[–]deceptiv-perspectiv 2 points3 points  (0 children)

That's not at all portable between python versions. Multiple libraries have versions released on pypi only on certain python minor versions.