Python was upgraded, Do I need install all the libraries again?

Hi everyone,

Just a background, I am running automated tests using Robot Framework (installed thru PIP). I have no control over our EC2 instances and the Python gets upgraded on the server frequently. Once the upgrade is completed, I usually run a script to install the Robot Framework and other libraries again. Is there a way where all old libraries will still be working in the new Python version?

You should make a venv and install them into that, not the system Python.

I would also do something to lock down the environment, to prevent the frequent system Python updates causing spurious test failures. Automated tests become frustrating if the passes and failures are not reproducible.

For example, if the tests can be isolated or only need simple network access, if Docker or Podman is provided on the EC2 instance, look into making a Docker image to run the tests in.
This could be based on one of the standard Python images, or even a reliable Robot image if there is one. Then make sure to pin the version, so you control it.

Thanks James. I agree the containerized version of the tests is still the best approach to have full control of the test environment and versioning. However, this is a limitation in my current organization. We are only limited with running the robot tests on Windows instances. Thanks for the insight on the venv!

1 Like

Normally, if only the maintenance/bugfix part of the version string changed, then no, there usually should not be any need to reinstall the libraries.

This means that when updating from pythonA.M.X to pythonA.M.Y or pythonA.M.Z, there should not be no need to re-install the libraries. But when updating from pythonA.M to pythonA.N or pythonA.O, then you need to reinstall the libraries.

For more concrete examples, when updating from python3.11.8 to python3.11.9, there should not be no need to reinstall the libraries. When updating from python3.11.8 to python3.12.4, then it is necessary to reinstall the libraries.

1 Like