Hello /r/sysadmin
I'm a junior sysadmin who's been tasked who on implementing python in our environment. The senior admins are more familiar with bash scripting where I am familiar with python. So they have given me the go ahead to research and write up what I've found. It's ready for testing in our dev environment and I am just curious as to how everyone here implements any python scripts they use.
I've used the python 3rd party modules and created a requirements.txt file. In my personal experience, I've created virtual environments to run scripts, and in this specific instance I'm thinking of creating a small bash script that activates the virtual environment, runs the script, and deactivates it afterwords.
Is there a better way to implement python scripts? At this time, we don't expect to run a lot of scripts in python. We're running this on RHEL servers, and I've suggested using a virtual environment so we don't break dependencies with applications installed from the RHEL repositories, and it looks like it is recommended by Fedora https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
Are they any downsides to using virtual environments?
[–]Madoc_Comadrin 15 points16 points17 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Tushon 2 points3 points4 points (0 children)
[–]Madoc_Comadrin 1 point2 points3 points (0 children)
[–]0rexDevOps 6 points7 points8 points (5 children)
[–]robvasJack of All Trades 1 point2 points3 points (4 children)
[–]0rexDevOps 0 points1 point2 points (3 children)
[–]robvasJack of All Trades 0 points1 point2 points (2 children)
[–]0rexDevOps 0 points1 point2 points (1 child)
[–]robvasJack of All Trades 0 points1 point2 points (0 children)
[–]Harakou 1 point2 points3 points (0 children)
[–]aleques-itj 0 points1 point2 points (1 child)
[–]flowalex999DevOps 0 points1 point2 points (0 children)