To add to Mauro’s excellent answer, I know you aren’t too keen on using environments but this is exactly the situation which environments aim to prevent.
If your code has an accompanying environment with a Manifest file, you are able to exactly replicate this environment including all dependencies when you later want to run it.
The issues seen in your other threads were things like DataFrames deprecating the df[:x] syntax for accessing columns - if you had used an environment, your code would just install the appropriate (outdated) DataFrames version which allows this column indexing, and your code would work.