I've installed Anaconda (with Python 3.5.2) and although while using IPython/PyCharm (after setting it to use Anaconda) I have access to all the packages, while using Python 3 through the terminal it refers to the python3.5.1 that comes with Ubuntu and it doesn't recognize any package.
I've set my path as explained here
echo $PATH
:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/myname/anaconda3/bin
How to solve this?
Best Answer
It looks like you were setting your
PATH
usingUnfortunately, this means that
/usr/bin/python3
comes first before//home/ofirarzi/anaconda3/bin/python3
, so your system Python 3 gets called instead of Anaconda's Python 3 when you runpython3
in the terminal. To fix this, you just need to reverse the order of the components ofPATH
, i.e., in your~/.profile
, doThen do
source ~/.profile
and trypython3
again. For the newPATH
to take effect in the terminal in the future without manually sourcing~/.profile
every time, you have to log out and then log in again or reboot.Note that the way I have exported
PATH
is also described by Anaconda's documentation at https://docs.continuum.io/anaconda/install#linux-install.