Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
539 views
in Technique[技术] by (71.8m points)

python - ImportError: No module named 'pandas'

I am trying to learn pandas and I haven't been able to import it into my code.

I have looked at other answers on this site and none of them have worked.

I just installed anaconda and installed everything through conda.

Here is a sample script that I am trying to run.

import pandas as pd

writer = pd.ExcelWriter('farm_data.xlsx', engine='xlsxwriter')
df.to_excel(writer, sheet_name='Sheet1')

workbook = writer.book
worksheet = writer.sheets['Sheet1']

chart = workbook.add_chart({'type': 'column'})

And the error it kicks back.

Traceback (most recent call last):

File "C:Usershiet01DocumentsPython Scripts ew 1.py", line 1, in

import pandas

ImportError: No module named 'pandas'

If you need any more information, please let me know and I can provide it.

Thanks in advance for any help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

below solved my issue:

apt-get install python3-pandas or apt-get install python2-pandas

Font: https://ask.fedoraproject.org/en/question/36529/installing-python-pandas/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...