Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
540 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 Reply

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/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...