gpt4 book ai didi

python - 安装 allennlp==0.3.0 时应该使用哪些版本的 sanic-cors、sanic 和 sanic-plugins-framework?

转载 作者:行者123 更新时间:2023-12-01 08:53:48 24 4
gpt4 key购买 nike

哪些版本的 python 软件包 sanic-cors , sanic ,和sanic-plugins-framework安装时我应该使用allennlp==0.3.0使用 Python 3.6 或 3.7?

当我运行时:

conda create --name selector-py36 python=3.6 
source activate selector-py36
pip install allennlp==0.3.0

我收到错误消息:

sanic-plugins-framework 0.6.3.dev20180717 has requirement sanic>=0.7.0, but you'll have sanic 0.6.0 which is incompatible.
sanic-cors 0.9.6 has requirement sanic>=0.8.1, but you'll have sanic 0.6.0 which is incompatible.

稍后会阻止我依赖 allennlp 的程序运行 ( RuntimeError: You cannot use Sanic-CORS with sanic < v0.7.0 ):

(selector-py36) dernon@ilcompn0:/mnt/ilcompnnco/selector$ 
python -m allennlp.run train data/allen_config_test.json --serialization-dir scratch
Traceback (most recent call last):
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/site-packages/allennlp/run.py", line 10, in <module>
from allennlp.commands import main # pylint: disable=wrong-import-position
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/site-packages/allennlp/commands/__init__.py", line 6, in <module>
from allennlp.commands.serve import Serve
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/site-packages/allennlp/commands/serve.py", line 25, in <module>
from allennlp.service import server_sanic
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/site-packages/allennlp/service/server_sanic.py", line 19, in <module>
from sanic_cors import CORS
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/site-packages/sanic_cors/__init__.py", line 11, in <module>
from .decorator import cross_origin
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/site-packages/sanic_cors/decorator.py", line 15, in <module>
from .extension import cors
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/site-packages/sanic_cors/extension.py", line 326, in <module>
instance = cors = CORS()
File "/mnt/ilcompnnco/anaconda3/envs/sensei-selector-py36b/lib/python3.6/site-packages/sanic_cors/extension.py", line 139, in __init__
raise RuntimeError("You cannot use Sanic-CORS with sanic < v0.7.0")
RuntimeError: You cannot use Sanic-CORS with sanic < v0.7.0

最佳答案

allennlp==0.3.0 没有正确的依赖项:

  • 它安装 sanic-cors 0.9.6,它需要 sanic>=0.8.1,但 allennlp==0.3.0 需要sanic>=0.6.0
  • 它安装 Sanic-Plugins-Framework==0.6.4.dev20181101,这会导致一些 ImportError: Cannot import name 'logger' with sanic- cors==0.9.3

要解决此问题:

pip install allennlp==0.3.0   # this will install sanic-cors==0.9.6, sanic-0.6.0 
# and Sanic-Plugins-Framework==0.6.4.dev20181101
pip install sanic-cors==0.9.3 # this will uninstall sanic-0.6.0 and install sanic-0.8.3
pip install Sanic-Plugins-Framework==0.6.3.dev20180717 # this will install sanic-0.8.3
pip install sanic==0.6.0

关于python - 安装 allennlp==0.3.0 时应该使用哪些版本的 sanic-cors、sanic 和 sanic-plugins-framework?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52920419/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com