0

I have installed PANDAS using -> pip install --upgrade pandas. "Requirement already up-to-date:--------" But when I use :

import pandas as pd

on spyder this is the error

import pandas as pd
Traceback (most recent call last):
File "<ipython-input-5-7dd3504c366f>", line 1, in <module>
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'

I tried most of the solutions provided on other stackoverflow questions but nothing supposed to be working. please help. Thank you

Tia
  • 521
  • 2
  • 6
  • 18
  • How are you running your script `python3` or `python2/python`? If you're running using `python3` then you have to install `pandas` for python3 separately. – the.salman.a Mar 20 '18 at 10:22

2 Answers2

1

The most common reasons to encounter this error is the incompatibility of pip installs and python versions.

Though the error log mentions that your pandas module is not available even after you've installed it, there is a possibility to run into this error is due to the presence of multiple/incompatible versions of python where you've failed to install pandas according to the specific python version.

So first check the python version that you're currently on using

python -V

And if you're on Python 2. , use

pip install pandas

If you're on Python 3. use

pip3 install pandas.

Then proceed on with your script. This at most should solve your issue.

Nayantara Jeyaraj
  • 2,624
  • 7
  • 34
  • 63
0

There must be two different pythons on your system 1) Anaconda 2) From Python.exe

Try to install pandas from conda command window.

Patel
  • 200
  • 2
  • 9
  • conda is not recognized C:\Users\va>conda --version 'conda' is not recognized as an internal or external command, operable program or batch file. – Tia Mar 20 '18 at 10:37
  • set it in your system path https://stackoverflow.com/questions/44597662/conda-command-is-not-recognized-on-windows-10 – Benedict K. Mar 20 '18 at 10:54