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
1.8k views
in Technique[技术] by (71.8m points)

python - Exporting CSV shows ImportError: cannot import name 'CompressionOptions' from 'pandas._typing'

When attempting to export to CSV the error below arises:

-I've tried updating pandas and then reverting to an older version with no luck.

~Anaconda4libsite-packagespandascoregeneric.py in to_csv(self, path_or_buf, sep, na_rep, float_format, columns, header, index, index_label, mode, encoding, compression, quoting, quotechar, line_terminator, chunksize, date_format, doublequote, escapechar, decimal, errors)
   3143         Examples
   3144         --------
-> 3145         >>> df = pd.DataFrame(dict(name=['Raphael', 'Donatello'],
   3146         ...                   mask=['red', 'purple'],
   3147         ...                   weapon=['sai', 'bo staff']))

~Anaconda4libsite-packagespandasioformatscsvs.py in <module>
     10 
     11 from pandas._libs import writers as libwriters
---> 12 from pandas._typing import (
     13     CompressionOptions,
     14     FilePathOrBuffer,

ImportError: cannot import name 'CompressionOptions' from 'pandas._typing' (C:UsersAbelAnaconda4libsite-packagespandas\_typing.py)

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

1 Answer

0 votes
by (71.8m points)
等待大神答复

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

...