ModuleNotFoundError
Traceback (most recent call last)
<ipython-input-13-93a644f2878c> in <module>()
3 import operator
4 from functools import reduce
----> 5 from ExceptionNotSeen import NotSeen
6 from naiveBayesClassifier.trainedData import TrainedData
7 from naiveBayesClassifier import tokenizer
ModuleNotFoundError: No module named 'ExceptionNotSeen'
我该如何解决这个问题?
转到此文件夹/Library/Frameworks/Python.framework/Versions/3.5/lib/py>thon3.5/site-packages/naive Bayes分类器将ExceptionNotSeen.py复制到当前项目路径(在其中运行主python程序,还有他们,但我只得到这样的错误
最佳答案
该项目的GitHub问题页上列出了其他人遇到的问题。此解决方案适用于以下个人:
seems there is something wrong with the install import or python path in system variable. Solve it this way
Go to this folder /Library/Frameworks/Python.framework/Versions/3.5/lib/py>thon3.5/site-packages/naiveBayesClassifier Copy ExceptionNotSeen.py to your current project path(where you run your main python program It solved that issue for me.
如果失败,则应验证ExceptionNotSeen.py的位置(如其他人所指出的那样),该错误似乎仅在虚拟环境中运行时发生。
最后,我建议您对Naive Bayes分类实现使用一个更完善的库。看看经常使用的sklearn软件包。
关于python - 当我尝试以朴素的贝叶斯分类器形式https://github.com/muatik/naive-bayes-classifier我得到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52173968/