liuhuanyong / QASystemOnMedicalKG

A tutorial and implement of disease centered Medical knowledge graph and qa system based on it。知识图谱构建,自动问答,基于kg的自动问答。以疾病为中心的一定规模医药领域知识图谱,并以该知识图谱完成自动问答与分析服务。
6.26k stars 2.14k forks source link

请问ahocorasick这个包是在哪里获取的呢,从官网和其他其它地方下载的都安装失败了 #10

Open ProWali opened 5 years ago

sh1shan commented 5 years ago

安装pyahocorasick可以用,你看下它的官方文档,有说明,pycharm导入有提示别管

swaker01 commented 5 years ago

请问这个提示是怎么处理的啊:AttributeError: module 'ahocorasick' has no attribute 'Automaton'

johnarchie1 commented 5 years ago

楼主解决了吗,我也是一直install不成功

swaker01 commented 5 years ago

楼主解决了吗,我也是一直install不成功 出现这个问题:AttributeError: module 'ahocorasick' has no attribute 'Automaton',应该是你把ahocorasick-python这个包给导进去了,所以你要把这个包删了,然后再重新导入pyahocorasick就行了

johnarchie1 commented 5 years ago

楼主解决了吗,我也是一直install不成功 出现这个问题:AttributeError: module 'ahocorasick' has no attribute 'Automaton',应该是你把ahocorasick-python这个包给导进去了,所以你要把这个包删了,然后再重新导入pyahocorasick就行了

我的没有那个问题,是这样的: C:\Users\john archie>pip install pyahocorasick Collecting pyahocorasick Using cached https://files.pythonhosted.org/packages/f4/9f/f0d8e8850e12829eea2e778f1c90e3c53a9a799b7f412082a5d21cd19ae1/pyahocorasick-1.4.0.tar.gz Installing collected packages: pyahocorasick Running setup.py install for pyahocorasick ... error Complete output from command c:\python\python.exe -u -c "import setuptools, tokenize;file='C:\Users\JOHNAR~1\AppData\Local\Temp\pip-install-_6pmu264\pyahocorasick\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\JOHNAR~1\AppData\Local\Temp\pip-record-jw88oy29\install-record.txt --single-version-externally-managed --compile: running install running build running build_ext building 'ahocorasick' extension creating build creating build\temp.win-amd64-3.7 creating build\temp.win-amd64-3.7\Release cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DAHOCORASICK_UNICODE= -Ic:\python\include -Ic:\python\include /Tcpyahocorasick.c /Fobuild\temp.win-amd64-3.7\Release\pyahocorasick.obj error: command 'cl.exe' failed: No such file or directory

----------------------------------------

Command "c:\python\python.exe -u -c "import setuptools, tokenize;file='C:\Users\JOHNAR~1\AppData\Local\Temp\pip-install-_6pmu264\pyahocorasick\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\JOHNAR~1\AppData\Local\Temp\pip-record-jw88oy29\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\JOHNAR~1\AppData\Local\Temp\pip-install-_6pmu264\pyahocorasick\

swaker01 commented 5 years ago

楼主解决了吗,我也是一直install不成功 出现这个问题:AttributeError: module 'ahocorasick' has no attribute 'Automaton',应该是你把ahocorasick-python这个包给导进去了,所以你要把这个包删了,然后再重新导入pyahocorasick就行了

我的没有那个问题,是这样的: C:\Users\john archie>pip install pyahocorasick Collecting pyahocorasick Using cached https://files.pythonhosted.org/packages/f4/9f/f0d8e8850e12829eea2e778f1c90e3c53a9a799b7f412082a5d21cd19ae1/pyahocorasick-1.4.0.tar.gz Installing collected packages: pyahocorasick Running setup.py install for pyahocorasick ... error Complete output from command c:\python\python.exe -u -c "import setuptools, tokenize;file='C:\Users\JOHNAR1\AppData\Local\Temp\pip-install-_6pmu264\pyahocorasick\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\JOHNAR1\AppData\Local\Temp\pip-record-jw88oy29\install-record.txt --single-version-externally-managed --compile: running install running build running build_ext building 'ahocorasick' extension creating build creating build\temp.win-amd64-3.7 creating build\temp.win-amd64-3.7\Release cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DAHOCORASICK_UNICODE= -Ic:\python\include -Ic:\python\include /Tcpyahocorasick.c /Fobuild\temp.win-amd64-3.7\Release\pyahocorasick.obj error: command 'cl.exe' failed: No such file or directory

----------------------------------------

Command "c:\python\python.exe -u -c "import setuptools, tokenize;file='C:\Users\JOHNAR1\AppData\Local\Temp\pip-install-_6pmu264\pyahocorasick\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\JOHNAR1\AppData\Local\Temp\pip-record-jw88oy29\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\JOHNAR~1\AppData\Local\Temp\pip-install-_6pmu264\pyahocorasick\

不太清楚你这咋弄的,我是直接再pycharm上试的

tectal commented 5 years ago

请问ahocorasick这个包是在哪里获取的呢,从官网和其他其它地方下载的都安装失败了

johnarchie1 commented 5 years ago

请问ahocorasick这个包是在哪里获取的呢,从官网和其他其它地方下载的都安装失败了

官网的包肯定没问题,我最后解决是因为python的版本和MSVC的版本不匹配,重新下了VC2017就成功了

violahuyoujin commented 5 years ago

我下载了MSVC后,在pycharm上下载了pyahocorasick包,在项目工程包里删除了ahocorasick,运行成功了

yan624 commented 5 years ago

执行命令 conda install -c https://conda.anaconda.org/conda-forge pyahocorasick 或者参考博客

sunlinkun commented 5 years ago

可以参考下这篇博客https://blog.csdn.net/weixin_34613450/article/details/89316569 安装成功

claire12579 commented 4 years ago

pip3 install pyahocorasick -i https://pypi.tuna.tsinghua.edu.cn/simple/

pengrui-China commented 3 years ago

我下载了MSVC后,在pycharm上下载了pyahocorasick包,在项目工程包里删除了ahocorasick,运行成功了

老哥,问一下最后回答的时候一直自动回复是怎么回事呢