Home > Net >  python versions (conda -forge)
python versions (conda -forge)

Time:03-07

I am using 18.04 Ubuntu with Anaconda.Recently i have trying to install OpenCV through conda-forge channel in the base environment. I did not install purposely any Python version and did not use any pip command either in base environment. Now, in the base environment, if execute just python, i get the same python version as system version and if execute python3 , i get the version installed by conda-forge. Please refer the screen shot. Python_on_Conda_base

I would like to know what is difference between python and python3 command?.What is should i keep in mind? basically i prefer the version 3.7.5 Python .So, only the Python3 has uses different version. So, question what i should take note when i using python3 some_script.py? what is pros and cons of having this 2 version?

So far,i did not face any issues, but removed the conda-forge channel from Anaconda to avoid any conflicts. Any thoughts? After posting this question, i have noticed python --version command gives Python 3.7.5 on Conda base environment and Ubuntu terminal (outside Conda)

CodePudding user response:

You most likely have set an alias for python to point to the python3 binary.

Check this by typing type python, which will probably give you

python is aliased to ...

The crux here is that an alias will not be detected by which and as you revealed in the comments your which python returns the correct python version from your conda base environment, which makes an alias the most likely explanation, as PATH issues can be ruled out.

If above command does indeed reveal an alias, then check you .bashrc or similar file that you might have modified for a line alias python=.... Delete it, restart your terminal and everything should work normally

  • Related