PythonError

错误:

IndentationError: expected an indented block

解决:

you have an indentation error. It is probably caused by a mix of tabs and spaces.

格式不对,没有按tab键。


错误:

解决:

在路径前加个r


错误:

NameError: name 'raw_input' is not defined

解决:

python3用input()


错误:

unboundlocalerror: local variable 'os' referenced before assignment

解决:

。。。


错误:

ModuleNotFoundError: No module named 'gensim'

解决:


错误:

AttributeError: 'dict' object has no attribute 'iteritems'

解决:


错误:

AttributeError: module 'numpy' has no attribute 'exe'

解决:

np.exe()打错,应该为np.exp()


错误:

UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 4: illegal multibyte sequence

解决1:

对所有open(stop_word_path)中加上open(stop_word_path,'r',encoding='UTF-8')

解决2:

改成open(stop_word_path,'rb')


问题:

ModuleNotFoundError

ModuleNotFoundError: No module named 'urllib2'

解决:

python3中应为urllib.request


问题:

AttributeError: 'str' object has no attribute 'decode'

解决:

去掉  .decode('utf-8')  部分


问题:

OSError: [Errno 22] Invalid argument: 'D:\\PyCharm\\Projects\\medical-entity-recognition-master\train_test_data\train_bio_word.txt'

解决:

改成open(r"C:\description_files\program_description.txt","r")

或open("program_description.txt","r")

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,436评论 0 10
  • 小孩子不听话是为什么?一朋友问我。 “少了影响力!” 凡是问题都有许多答案,这个也一样,可无论你是答了她进入叛逆期...
    雅俗儿的手帐阅读 516评论 8 9
  • Interviewed Andy Yu 职业规划以兴趣为出发点,助力可持续性发展 一方面兴趣可以带来主动性,单反职...
    Rutona阅读 239评论 0 0
  • 之前看了番茄工作图解,查阅了相关资料后发现此书。在实施番茄工作法中有三个难点1.生活中大块时间较少或许是强迫症,如...
    scarqin阅读 2,042评论 2 2