Mangoliini
Mangoliini

Reputation: 1

import pandas returning 'no module named pandas'

I cannot use pandas in my script. It's my first time using a package, and it doesn't work. When I use pip install pandas the cmd prompt returns:

PS C:\Users\young> pip install pandas
3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (1.3.1)
Requirement already satisfied: python-dateutil>=2.7.3 in c:\users\young\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from pandas) (2.8.2)       
Requirement already satisfied: pytz>=2017.3 in c:\users\young\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from pandas) (2021.1)
Requirement already satisfied: numpy>=1.17.3 in c:\users\young\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from pandas) (1.21.1)
Requirement already satisfied: six>=1.5 in c:\users\young\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from python-dateutil>=2.7.3->pandas) (1.1PS C:\Users\young> pip3.9 install wheel
Requirement already satisfied: wheel in c:\users\young\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (0.36.2)
included in the snippet is pip install wheel, so I have that covered.

Upvotes: 0

Views: 2030

Answers (5)

su2187
su2187

Reputation: 171

Check if you have any file/folder named pandas in the working directory of your python file. If yes, then rename it. Otherwise Python would import that file instead of the pandas module.

Upvotes: 0

qAIq
qAIq

Reputation: 1

See if a folder named pandas is already there (where it says it is or where your editor/python keeps the packages), If so, delete that and try again. Try restarting your editor (sometimes that works with pycharm if it's being laggy, for me at least).

Also, that is not what returns when I try to install pandas. Make sure your command is pip install pandas

Upvotes: 0

TrexS.
TrexS.

Reputation: 3

The code snippet shows that pandas module was already installed on your device. Now, simply type

`import pandas` 

and start writing the coding. It should not give you any errors.

If you are using an ios device then pip3 install _pakage name_ or you can use Sudo also as pip does not work for me.

Upvotes: 0

Ashutosh Dwivedi
Ashutosh Dwivedi

Reputation: 11

This is a typical issue with multi installation of python. Please check if you have more than one installation of Python. if yes than ........

You can check where your installed packages should be saved with the following

import os os.path and then install using the following terminal instruction

pip3 install pandas -t /usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6

Upvotes: 1

enter image description here

This shows that pandas was already installed. Try to import and use.

Upvotes: 1

Related Questions