Pandas package not recognized in notebook jupyter

Asked

Viewed 222 times

0

Hello, can anyone help understand why the notebook jupyter does not recognize the panda package?

created a virtual environment and installed the packages to analyze a set of Enem data, but when calling the notebook jupyter and typing: import pandas as pd the message appears below.

NameError                                 Traceback (most recent call last)
<ipython-input-3-0efef42136cf> in <module>
----> 1 microdadosEnem = pd.read_csv("brutos/microdados_enem_2018/DADOS/MICRODADOS_ENEM_2018.csv")

NameError: name 'pd' is not defined
  • 1

    Hello Michele, are you using Jupyter on your local machine, or through some website? And why make a virtual environment to use it? Yeah, the same is kind of a virtual isolated ambience.

  • Before importing the pandas use !pip install pandas with the exclamation mark in front. Then just rotate the cell

  • Hello @Elias Oliveira, I created a virtual environment and call the command prompt jupyter then go to the browser...

  • Hello @Paulomarques, I’ll do what you said to see if it works...

  • Got it, in that case just do as @Paulomarques said and use the ! Pip install pandas

  • The mistake is NameError: name 'pd' is not defined, and not ImportError: No module named pandas. I mean, you didn’t turn the remote import pandas as pd and tried to use the pd. Paulo already made a comment about this in Michele’s "answer" (which is not an answer and should be a comment), but I’m just pointing out.

Show 1 more comment

1 answer

0

I believe you should perform the following command on your terminal.

pip install pandas

Remember that after performing this Pip procedure, you should put at the beginning of your code:

import pandas as pd

There yes the pandas module will be executed successfully!

It should be remembered that if you are trying to do this locally it is recommended to install the environment variable. Here is a link to how to perform this procedure:

https://medium.com/@victorromariopazdejesus/python-3-configuring-Ari%C3%A1veis-de-ambiente-no-windows-10-63059c7192e6

Browser other questions tagged

You are not signed in. Login or sign up in order to post.