Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Pandas installed but not recognised by IDLE on Mac

I am relatively new to Python.

I had installed Anaconda when I was practicing Python. Jupyter Notebooks was causing issues so I installed IDLE.

The installation of Python and Idle3 is in the same location.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

(base) myname@myMac ~ % which python
/Users/myname/opt/anaconda3/bin/python
(base) myname@myMac ~ % which idle3
/Users/myname/opt/anaconda3/bin/idle3

Pandas is also installed in the same user

(base) myname@myMac~ % pip install pandas
Requirement already satisfied: pandas in ./opt/anaconda3/lib/python3.9/site-packages (2.0.0)
Requirement already satisfied: tzdata>=2022.1 in ./opt/anaconda3/lib/python3.9/site-packages (from pandas) (2023.3)
Requirement already satisfied: python-dateutil>=2.8.2 in ./opt/anaconda3/lib/python3.9/site-packages (from pandas) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in ./opt/anaconda3/lib/python3.9/site-packages (from pandas) (2022.1)
Requirement already satisfied: numpy>=1.20.3 in ./opt/anaconda3/lib/python3.9/site-packages (from pandas) (1.21.5)
Requirement already satisfied: six>=1.5 in ./opt/anaconda3/lib/python3.9/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)

In IDLE Shell 3.11.3

import pandas
Traceback (most recent call last):
  File "<pyshell#19>", line 1, in <module>
    import pandas
ModuleNotFoundError: No module named 'pandas'

Additional Data that could help

(base) myname@myMac 3.11 % which -a python python2 python2.7 python3 python3.6 python3.11       
/Users/myname/opt/anaconda3/bin/python
/Users/myname/opt/anaconda3/bin/python3
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3
/usr/local/bin/python3
/usr/bin/python3
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
/usr/local/bin/python3.11

Pandas is working fine on Jupyter Notebook. Suggestions would be helpful.

I wanted to access the pandas module in python. I have checked other answers but none have been directing to this issue. If the installation is correct, pandas should be running fine.

>Solution :

your default Python version is 3.9. So when you use pip to install any library it uses the pip of python3.9. So you will have no problem importing pandas in IDLE Shell 3.9.* if you have 3.9 shell.

So to use the pip of python3.11 use ->

python3.11 -m pip install pandas

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading