如何解决在python3.7中安装pycsv的错误?

基兰·扎霍尔(Kiran Zahoor)

因为我正在执行此代码,并且需要CSV库才能执行此操作。

import csv

class CsvWordReplacer(WordReplacer):
    def __init__(self, fname):
        word_map = {}
        for line in csv.reader(open(fname)):
            word, syn = line
            word_map[word] = syn
            super(CsvWordReplacer, self).__init__(word_map)
replacer = CsvWordReplacer('synonyms.csv')
a=replacer.replace('bday')

通过使用cmd(administrator)中的命令,在使用pyserial3.2Python 3.7中安装库时

pip install --user pycsv

我发现以下错误:

 Traceback (most recent call last):
      File "<string>", line 1, in <module>
        long_description=io.open("history.md", encoding='utf8').read(),
    FileNotFoundError: [Errno 2] No such file or directory: 'history.md'

如果有人可以帮助我,那将很棒。

公猪队

您不需要安装csv库模块。它是标准库的一部分。卸载pycsv(根据其在PyPI上的文档,它不支持Python 3,最近一次更新已超过3年),只能使用csv

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何解决python3的此pip错误?

如何解决python3中的“EOFError: EOF when reading a line”错误?

Python3内存错误的根源是什么?以及如何解决呢?

如何解决与Python3重构中的遍历列表相关的问题

我该如何解决无法ImportError:无法在python3中导入名称

苹果系统; Python3; FileNotFoundError:[错误2]没有这样的文件或目录:”。如何解决?

如何解决python中的ujson包安装错误

如何解决该收敛错误?Python 3统计模型

如何解析Python3 BeautifulSoup中的onclick()文本?

如何解决 Python 中的“MissingSchema”错误?

如何解决Python中的内存错误

如何解决Python中的编码错误

如何解决Python中的StopIteration错误?

如何解决在windows中为python安装web3的问题?

如何解决Python诗歌依赖错误

如何解决Python 3.6 itertools错误?

如何解决python中的拆分问题?

如何解决python中的for循环问题?

如何解决python中的这个AttributeError?

如何解决python中的input()问题?

如何解决Python Gekko中的积分?

如何解决Python中的编码问题

如何解决 Python 中的 KeyError 问题?

如何解决python中的Tkinter问题?

如何解决在virtualenv中安装python软件包的错误?

如何解决 vue 3 中的“this is undefine”错误

如何解决 AS3 中的图例错误#2025?

如何解决在Mac Mojave中安装xmgrace的错误?

Python 3 如何解决 urllib.parse.urlencode 在 Python 3.4.2 中缺少 quote_via