I have been learning machine learning and neural networks for some time. Therefore I have both 2.7.11 and 3.5.2 versions of python on my Ubuntu 16.04 installed with the purpose of learning Tensorflow. I sometimes may use python interchangeably, can I continue using both of them, or there are some constraints?
1 Answer
This is fine, and completely normal. Python 2.x and Python 3.x are completely separated on the file system.
It only becomes a problem if either you or a library you are using, intentionally does something wrong by crossing the paths. As long as you don't alter the standard installation, you can use either one. For new code, it is generally recommended that you should write only Python 3.x code though.
-
I have installed pip for python 2 and I was going to install pip3 for python3 but it shows
Unable to locate package python-pip3
. The reason as I believe is that I already have pip. What should I do? Feb 21, 2017 at 15:47 -
Python 3.x packages are "python3-foo" not "python-foo3". You need
python3-pip
there.– dobeyFeb 21, 2017 at 15:59
python
to invoke Python2, andpython3
to invoke Python3. Do NOT create a symlink that pointspython
at python3! If you need different versions of Python than the defaults, use Anaconda and create some environments.sudo apt install python3-pip
andsudo apt install python-pip
so unless you have messed up your python install they should install without a fuss...