hey, I am a beginner in installing external modules i.e. pandas
my IDLE shell is 3.11.3 which is the latest and my Python is also the latest version 3.11. after installing pandas from the cmd prompt but my IDLE shell did not recognize it showing module not found
import pandas
Traceback (most recent call last):
File “<pyshell#1>”, line 1, in
import pandas
ModuleNotFoundError: No module named ‘pandas’
Pandas can be installed for Python 3.12.
The original problem may also have been caused by having two different Python versions and by not using a Python virtual env. I’m wondering how @k2suraj tried to install pandas and for which Python the install was done.
(I should add that pandas is not yet fully supported for 3.12, according to the pandas issue tracker, but installing it is possible.)
The IDLE version is the Python version a particular IDLE comes with. IDLE runs code with the same version of Python that is running IDLE. In particular, imports are done by Python and package-not-found failures are due to a package not being installed in the python running IDLE.
3rd party packages must be installed for each version of python that you want to run the package with. A common beginner problem when having more than one version of Python is installing xyz for one version of Python and then running IDLE with a different version. The failure is the same as if one directly ran the ‘other’ Python version and did the same import. I am thinking about an addition to the IDLE doc to explain this.
Others have pointed to the particulars of this case.