[Python] How to import pandas and matplotlib on Python 3.5 IDLE

Discussão em 'Python' iniciado por Stack, Julho 17, 2025.

  1. Stack

    Stack Membro Participativo

    I am running the following code:

    import pandas as pd
    import matplotlib.pyplot as plt
    from matplotlib import style
    style.use('ggplot')

    web_stats = {"Day":[1,2,3,4,5,6],
    "Visitors":[43,53,34,45,64,34],
    "Bounce_Rate":[65,72,62,64,54,66]}
    df = pd.DataFrame(web_stats)
    print(df)


    It works just fine for me in the Jupyter notebook. But I am getting errors when I try to run it on IDLE, and I am wondering how to make it work there, too.

    Here are the errors I'm getting:

    Traceback (most recent call last): File "C:\Users\theca\AppData\Local\Programs\Python\Python35-32\pandas.py", line 1, in import pandas as pd File "C:\Users\theca\AppData\Local\Programs\Python\Python35-32\pandas.py", line 2, in import matplotlib.pyplot as plt ImportError: No module named 'matplotlib'

    I am new to Python, please to help. Thanks!

    Continue reading...

Compartilhe esta Página