Python upgrade and requirements compatibility

1k views Asked by At

I have a Python 3.6 project that I want to migrate to Python 3.8. I also have a requirements.txt file generated with pip freeze, which is used by the Python 3.6 project. Is there a way to know if the packages listed in requirements.txt, with their own specific pinned version, support/are compatible with Python 3.8?

I could imagine some ways to do that, like check the packages classifiers or look at tox.ini and so on, but the requirements file has ~300 packages listed and doing that manually would be cumbersome at best.

1

There are 1 answers

0
Jiří Baum On BEST ANSWER

If you do a pip install -r requirements.txt under the new version of Python (in a venv), it'll tell you if it can't find that particular version of a package for it

If there are several missing, it'll be a bit annoying, because it'll only tell you one at a time, but hopefully there won't be too many

Not sure if there's an official documented procedure in the docs, but this should give you a quick idea, especially on the happy path where it just works