Should I reinstall each module again if I install a new version of Python?

I just installed Python 3.6 and started the terminal, tried importany of the modules that I already installed in 3.5 (rsa, matplotlib, enchant, ...), and it returned:

ModuleNotFoundError: No module named 'module_name'  

However, they still work when I run Python 3.5. What should I do?

+4
source share
2 answers

If you install another version of Python, you will not have the modules that you already installed for your old version.

Python, , . , Python, , , . , Python Python , . , Python 2.7 Python 3.6, 2 3.

, Python, PIP pythonX.Y, X.Y - , :

python2   -m pip install SomePackage  # default Python 2
python2.7 -m pip install SomePackage  # specifically Python 2.7
python3   -m pip install SomePackage  # default Python 3
python3.6 -m pip install SomePackage  # specifically Python 3.6

, - , , .

+3

cmd-

pip install module_name
0

Source: https://habr.com/ru/post/1675359/


All Articles