Unexpected output using visual studio code to pandas

Hi all,

I have been struggling to fix and issue for hours and I am already wornout! I will appreciate quick help on this.

Few months ago, I wrote some python codes using, pandas, numpy and matplotlib in Jupiter notebook and saved them in ipynb format. I used python 3.7
Now I am trying to run the codes using github desktop. I used github desktop to open the ipynb file using visual studio code but when I run the file, I get the module not found error message. I am using python 3.9

I am not yet an expert so I will appreciate simple explanations.

Thanks

It looks like you do not have pandas installed for Python 3.9.

If you installed your Jupyter using pip then install pandas also using pip. Possible procedure:

If you can run your Jupyter notebook using this command:

py -3.9 -m jupyter notebook

Then you can install pandas for the same environment using this command:

py -3.9 -m pip install pandas

Note: Nowadays you should use the newer JupyterLab instead of the old Jupyter notebook.

Thanks so much for your timely response.

I have tried to install it but neither worked.
I get the message below.

I will appreciate any further assistance.

image

py is a command to be run from the Windows command line cmd.exe or PowerShell. BTW how do you normally start your Jupyter and how did you install it?

It installed!
I ran the command in command line and it is now showing me “installing”. I am just waiting for it to finish installing.

I usually load anaconda, then select jupiter notebook.

Thanks a lot.

Just an update:

This is the mesage I have received.

I will tru to run the code in visual studio again and I hope it works now. Thanks

I have no experience with Anaconda. If you install your environment using Anaconda, then you should probably install everything using Anaconda.

I have no idea if Anaconda can cope with multiple Python versions. Maybe not…

Sorry, I didn’t mean to borther you again.

I tried one more time to run the code on visual studio code but it is giving me thesame message.

Any further help please?

As I wrote, probably Anaconda cannot work with multiple Python versions.

You can wait if there is someone experienced with Anaconda.

Alternatively if you do not mind uninstalling Anaconda completely and all the Python versions. You can do it and reinstall a single Python version a single way (either Anaconda or the normal installation).