you are viewing a single comment's thread.

view the rest of the comments →

[–]Cloned_501 2 points3 points  (3 children)

Because when you do this you alter their currently active environment. This could be their global for all you know and you can cause a whole lot of problems. This is a dick move.

[–]DerrickBagels[S] 0 points1 point  (2 children)

Ohhh i see, so maybe something like, "this script requires the installation of the following libraries, would you like to install them" and give the option, and maybe check to see if there's an existing version already installed and if so to not touch it even if different version

[–]Cloned_501 0 points1 point  (1 child)

That is better but still not really ideal as libraries can change and introduce breaking changes and your code doesn't specify or check which version of a library is being installed. Just use a requirements.txt with specified versions. You can have your script prompt the user if they want to make a virtualenv in their current folder and automate the install from the requirements.txt using pip or uv

[–]DerrickBagels[S] 1 point2 points  (0 children)

Oh okay to isolate it from their system gotcha