netease-youdao / QAnything

Question and Answer based on Anything.
https://qanything.ai
GNU Affero General Public License v3.0
11.95k stars 1.16k forks source link

Windows11系统,纯python环境安装,出现找不到nltk #279

Open Feige-cn opened 7 months ago

Feige-cn commented 7 months ago

(qanything) D:\QAnything>bash scripts/run_for_7B_in_Linux_or_WSL.sh wsl: 检测到 localhost 代理配置,但未镜像到 WSL。NAT 模式下的 WSL 不支持 localhost 代理。 即将启动后端服务,启动成功后请复制[http://0.0.0.0:8777/qanything/]到浏览器进行测试。 运行qanything-server的命令是: python3 -m qanything_kernel.qanything_server.sanic_api --host 0.0.0.0 --port 8777 --model_size 7B Traceback (most recent call last): File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/mnt/d/QAnything/qanything_kernel/qanything_server/sanic_api.py", line 20, in from qanything_kernel.configs.model_config import DT_7B_MODEL_PATH, \ File "/mnt/d/QAnything/qanything_kernel/configs/model_config.py", line 2, in import nltk ModuleNotFoundError: No module named 'nltk'

qanything环境下的nltk从3.8降到3.7/3.6都不行,nltk明明已经被安装,但是这里仍然提示找不到。这是为什么啊?

NeroHin commented 7 months ago

CleanShot 2024-04-23 at 20 14 37

應該是 Python / Python3 執行的問題,Python3 的目標會是本機上的、Python 是當前環境的

jacinli commented 7 months ago

这个和module应该关系不大,你看一下,应该是要去联网自动下载语料库的,你最好建一个干净的环境,同时保证深度学习环境是对的。我的环境是3.11 git1

hgsw commented 6 months ago

开始我有这个问题,项目clone下来后,在requirements.txt 目录下执行pip install -r requirements.txt 后来就好了

neomx7 commented 6 months ago

应该是 nltk没有正确安装。可以通过 python 命令 执行 import nltk 看看有什么错误信息。 我的报错如下

`Python 3.11.8 | packaged by Anaconda, Inc. | (main, Feb 26 2024, 21:34:05) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import nltk Traceback (most recent call last): File "", line 1, in File "C:\ProgramData\anaconda3\envs\qanything-python\Lib\site-packages\nltk__init.py", line 138, in from nltk.text import * File "C:\ProgramData\anaconda3\envs\qanything-python\Lib\site-packages\nltk\text.py", line 29, in from nltk.tokenize import sent_tokenize File "C:\ProgramData\anaconda3\envs\qanything-python\Lib\site-packages\nltk\tokenize__init__.py", line 65, in from nltk.tokenize.casual import TweetTokenizer, casual_tokenize File "C:\ProgramData\anaconda3\envs\qanything-python\Lib\site-packages\nltk\tokenize\casual.py", line 49, in import regex # https://github.com/nltk/nltk/issues/2409 ^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\envs\qanything-python\Lib\site-packages\regex\init__.py", line 1, in from .regex import * File "C:\ProgramData\anaconda3\envs\qanything-python\Lib\site-packages\regex\regex.py", line 417, in import regex._regex_core as _regex_core File "C:\ProgramData\anaconda3\envs\qanything-python\Lib\site-packages\regex_regex_core.py", line 21, in import regex._regex as _regex ModuleNotFoundError: No module named 'regex._regex'`

然后 换了一个 regex 版本就好了,如下: pip install -U regex==2024.4.16

neomx7 commented 6 months ago

注意需要在wsl环境下安装。 image

yc4805551 commented 5 months ago

我也同样的问题,请告知我如何解决的

jacinli commented 5 months ago

重新下载这个仓库,然后创建一个新的环境,再试一试pip install -e . (请确保代理正常,以及深度学习环境的cuda和gpu版本要一致,最好使用纯ubuntu版本,wsl的版本效果不太好)这里给出了双系统的超详细链接,可以参考:https://zhuanlan.zhihu.com/p/617640635

hgsw commented 5 months ago

非常感谢,可以帮忙看下这个issue吗 05-Qwen2-7B-Instruct Lora 微调报错 #176 https://github.com/datawhalechina/self-llm/issues/176

在 2024-06-14 10:23:00,"jacinli" @.***> 写道:

重新下载这个仓库,然后创建一个新的环境,再试一试pip install -e . (请确保代理正常,以及深度学习环境的cuda和gpu版本要一致,最好使用纯ubuntu版本,wsl的版本效果不太好)这里给出了双系统的超详细链接,可以参考:https://zhuanlan.zhihu.com/p/617640635

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

num-doc commented 1 month ago

这个和module应该关系不大,你看一下,应该是要去联网自动下载语料库的,你最好建一个干净的环境,同时保证深度学习环境是对的。我的环境是3.11 git1 @Feige-cn @hgsw @yc4805551 请问大家解决了吗 应该是需要单独下载一个语料包 请问方便把这个单独打包发给我马