The packages I installed work perfectly in Jupyter Notebooks but when I try importing the same packages in Sublime Text I get the following error message:
ImportError: No module named flask
Interestingly, some packages (like matplotlib and numpy) import with no problem but some (like flask and networkx) do not.
I am currently on Python Version 3.7.6 and I have tried sudo & pip3 install.
Anyone have any idea what is happening?
That sounds like you've installed those packages in the environment in which Jupyter is running, but not in the environment where Sublime Text is running.
In order to be able to use different combinations of packages on different projects, python packages are often installed into an environment (often "virtual environment", though there can be others). It sounds like flask and networkx were installed that way, so you only get them from your Jupiter "project" but not your Sublime Text "project". The matplotlib and numpy libraries are probably installed by default.
Two solutions, depending on the circumstances:
OR