user8358234
user8358234

Reputation: 201

How can I check which installation of python I'm using and remove all others?

I was trying to import pandas, and I have Anaconda installed but when I run it, it says ImportError: No module named pandas

So in terminal, I typed which -a python and the output was usr/bin/python

Then I typed in the command ls -l /usr/bin/python* and my output was:

-rwxr-xr-x  1 root  wheel  66736 May  5  2016 /usr/bin/python
-rwxr-xr-x  5 root  wheel    925 Oct 23  2015 /usr/bin/python-config
lrwxr-xr-x  1 root  wheel     75 May 19  2016 /usr/bin/python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
lrwxr-xr-x  1 root  wheel     82 May 19  2016 /usr/bin/python2.6-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config
lrwxr-xr-x  1 root  wheel     75 May 19  2016 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x  1 root  wheel     82 May 19  2016 /usr/bin/python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
-rwxr-xr-x  1 root  wheel  66736 May  5  2016 /usr/bin/pythonw
lrwxr-xr-x  1 root  wheel     76 May 19  2016 /usr/bin/pythonw2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6
lrwxr-xr-x  1 root  wheel     76 May 19  2016 /usr/bin/pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7

I run my scripts by creating a PATH variable in terminal and running the script in terminal. I wanted to know which python I'm using and what/how I can rid of the other ones that are unnecessary. So for example, I would write something like export ENGINE=/home/username/Software/... and then each time I wanted to execute a python script in terminal I just call it like $ENGINE test.py

Upvotes: 0

Views: 195

Answers (1)

Franco Tume Fiestas
Franco Tume Fiestas

Reputation: 46

If you are using Anaconda and the root environment, just run python -V in your terminal and it will print the version

Upvotes: 2

Related Questions