Search code examples
pythonpandasjupyter-notebooklibraries

Jupyter Notebook unable to recognize pandas library: Python


I use Windows operating system both personally in my home and at office. The Jupyter Notebook in my personal laptop is able to recognize pandas library. I can read csv file, assign it's content to a numpy array and do many things.

I run the same Jupyter Notebook file in my office. Latest version of pandas is installed and wheel is also installed.

Now, the confusing part is If I run the code in python console, it looks like this. enter image description here

Absolutely no error at all.

The same thing in my office's Jupyter Notebook looks like this. It cannot find pandas.

enter image description here

What could be wrong with my Jupyter Notebook in office's computer? I have restarted the kernel, opened in new browser to no avail.

Thanks in Advance


Edit 1


Jupyter Notebook already has pandas and wheel. I can see them when I run !pip list command. I even tried to upgrade if there is any latest version of pandas.

enter image description here

The pandas and wheel in Jupyter Notebook and my local installation has exactly same version installed.

enter image description here

Both are on same directory: D:\Projects\Python\DataVisualization

And the problem still persists. :(


#Edit 2

As suggested by some SO users, I created a virtual environment named VE. On that virtual environment, I installed pandas. Along with pandas other libraries were also installed, i.e. pytz, six, python-dateutil and numpy.

enter image description here

I opened Jupyter Notebook from the virtual environment. Verified that pandas is installed there. And tried to import pandas. Yet the same error.

enter image description here

May be something is just wrong with my Chrome browser. It is controlled by system admins and I just can't uninstall and install it at my own volition. Let's see.


# Edit 3

I tried Jupyter Notebook on Microsoft Edge and it is reporting the same error. So no fault of Chrome.


Solution

  • I could not figure out exactly what caused the issue. But the issue vanished after doing a fresh install of Anaconda.