I am a very beginner for vscode and python and computer stuff in general.
I am having trouble importing pandas into vs code, and none of the previous posts was helpful for me since I literally can’t understand it and can’t follow their steps.
I am gonna show you what I have done so far.
First, I open the vscode and open terminal (powershell)
Second, I type pip3 install pandas
and it successfully install pandas
For example, I ran that command again, it gave me "Requirement already satisfied"
enter image description here
Third, as it seemed pandas is installed correctly, I type py
to open python in the terminal and type import pandas as pd
But, it gave me :
import pandas as pd
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named ‘pandas’
I really don’t know why it is happening and what to do to fix this.
I will appreciate any help you can give me.
Thanks,
2
Answers
pip
install pandas instead ofpip3
cmd
orgit bush
instead of powershellpip install pipenv
(on cmd)pipenv install pandas
pipenv shell
py
Make sure you are using the same interpreter as the one you installed the
pandas
library with.Run the following code to print out the python interpreter you are currently using
Copy the full path of the interpreter and install the
pandas
library for it using the commandModify the above path to the path you just got
It can also be done in the interactive window of the terminal