Some information about version i am using
pip -V
Result:
pip 6.1.1 from /usr/local/lib/python3.4/site-packages (python 3.4)
Next:
python -c "import sys,pip;print(sys.version,pip,pip.__version__)"
Result:
('2.7.6 (default, Mar 22 2014, 22:59:56) \n[GCC 4.8.2]', <module 'pip' from '/usr/lib/python2.7/dist-packages/pip/__init__.pyc'>, '1.5.4')
I have installed pandas by
sudo pip install pandas
sudo easy_install pandas
I can see pandas in my system using
pip list
Result
certifi (14.5.14)
nltk (3.0.2)
numpy (1.9.2)
pandas (0.16.1)
pip (6.1.1)
pyparsing (2.0.3)
python-dateutil (2.4.2)
pytz (2015.2)
setuptools (2.1)
six (1.9.0)
tornado (4.1)
But when I import it, it throws error
python
>>> import pandas
Error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pandas
Pandas is installed but why it is not working and how to make pandas work with my python interpreter
I don't see why you expect your Python 2 and Python 3 installations to be in sync. The output from
pip -V
clearly displays that it is running on Python 3.4, and the output ofpython -c "import sys,pip;print(sys.version,pip,pip.__version__)"
clearly indicates it is using Python 2.7 (look at the version number in the library path).By contrast, here's the same thing using a current virtual environment on my development system.
You will see that the
which
command shows thatpip
andpython
both come from the same binary directory, and that the versions are matched.Virtual environments were invented to keep the dependencies of one project from leaking into other projects. I suggest you think about starting to use them.