You cannot use the same libraries - the ones that are compiled for Python 3.6 will only work in that version.
However, it is easy to install the same libraries again for Python 3.7 -
You didn’t say how you installed python3.7, or what system you’re using. but if you know its folder - just use Pip for him . Eventually you can read about virtualenv and always create new virtualenv’s -
At first you have to type:
python3.7 -m ensurepip
python3.7 -m pip install numpy
If you are on Linux, and have installed Python in a system prefix (and not in your user folder), you may need to put "sudo" before the above commands.
In time: for libraries that are composed only of files .py
, with nothing compiled until it is possible to share the installation between different versions of Python (and is not the case with numpy) - but this requires careful folder management in which libraries used by the two versions are installed, as well as always making sure that libraries that have compiled modules are never in that shared folder: it’s just not worth it.
In general, the opposite is done: for each project using Python (and a backend developer in a company that uses micro-services may have tens of different projects), one creates a virtualenv, where all libraries are installed - in the correct versions required for each specific project. This ensures that there is no library version conflict between different projects.
Tried to
pip install numpy
?– Victor Stafusa
I think you have to install in python 3.7 via Pip
– Juliana Marques