Reputation: 25
In the usr/bin folder, there are three versions of Pythons installed: Python, Python2.6, Python2.7 (the folder names) - not sure what version is for Python folder.
My issue, originally, was that I tried to install the module 'pandas' to run a script, python keeps telling me pandas could not be found.
'pip freeze' shows me pandas is already installed. However, I could not find pandas using python>>help>>modules.
So I suspected there are multiple pythons installed causing pip installing for one of them, but the default python is a different one.
So my questions are - 1 Which python is the default one that comes with macOS Sierra? (I can confirm pandas currently is installed for Python, not Python2.6 or Python2.7) 2 Can I remove extra Pythons that do not have pandas? 3 How can I find what it the default Python when I type 'Python...' and how to install pandas for that python?
Solved: Thanks for the comments and reply. I used "python2.7 install pip" to install pip for python2.7. Then I used command 'pip2.7 install pandas'. This way, pandas is installed for the default python. (The command 'pip install pandas' on my machine, is installing for python 2.6.)
Upvotes: 0
Views: 5626
Reputation: 4647
pip --version
to see which version of Python you are installing a package for. You can also use pip list
to see which packages are currently installed.I highly recommend taking a look at virtualenv as it'll make keeping track of Python environments and their respective packages a lot easier.
Hope this helps!
Upvotes: 1