Christopheraburns / AWS-JPL-OSR-Challenge

Official repo of the AWS-JPL Open Source Rover challenge
Apache License 2.0
178 stars 112 forks source link

Installation of python packages should be managed using a virtual environment #6

Closed capsulecorplab closed 4 years ago

capsulecorplab commented 4 years ago

Line 7 - 9 of setup.sh uses sudo pip3 install for installing python packages. This installs python packages to the system-wide path and is generally considered bad practice. It is better (and more common ) practice to use a virtual environment, such as virtualenv, to manage the installation of python packages for a project. See Is it acceptable and safe to run pip install under sudo?

If it is of interest to install all python packages in a single installation script, consider specifying the minimum package requirements in an install_requires in a setup.py. See https://packaging.python.org/guides/distributing-packages-using-setuptools/#install-requires

Christopheraburns commented 4 years ago

@capsulecorplab you are correct, it is bad practice, (preference technically) to install Python packages system-wide. However, this code was built with the understanding that it will run in AWS Robomaker - which is ephemeral computing. There isn't a "user-space" vs "system-space" within a Robomaker simulation job. Indeed, the only way the code will run in an automated fashion is via a system-wide installation, hence the current design.