南骚北浪! 2022-05-02 19:07 采纳率: 0%
浏览 6

DeepQA在服务器上部署

问题遇到的现象和发生背景

你好,我在服务器部署github上DeepQA这个项目时遇到了一些问题。环境阿里云服务器安装项目时候使用docker进行构建。

问题相关代码,请勿粘贴截图

这是我的Docker文件

## Dockerfile to build DeepQ&A container image

FROM python:3.5.2

## Dependencies

RUN \
  apt-get -y update && apt-get -y install unzip

#RUN pip3 config set global.index-url https://pypi.douban.com/simple/
RUN  \
  pip3 install --trusted-host pypi.tuna.tsinghua.edu.cn -i https://pypi.tuna.tsinghua.edu.cn/simple \
  -U nltk \
  tqdm \
  django \
  asgiref==2.2.0 \
  asgi_redis \
  channels

RUN \
  python3 -m nltk.downloader punkt

## Tensorflow
ARG TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp35-cp35m-linux_x86_64.whl

RUN \
  pip3 install --trusted-host pypi.tuna.tsinghua.edu.cn -i https://pypi.tuna.tsinghua.edu.cn/simple \
  -U $TF_BINARY_URL

COPY ./ /root/DeepQA

## Run Config

# You should generate your own key if you want deploy it on a server
ENV CHATBOT_SECRET_KEY="w9+us]!@=^Rzu2%zw*8BFr*38}}#`9'D)8<'!&q(qa<'<g?/]+"
ENV CHATBOT_REDIS_URL="redis"
EXPOSE 8000

WORKDIR /root/DeepQA/chatbot_website
RUN python3 manage.py makemigrations
RUN python3 manage.py migrate

# Launch the server
CMD python3 manage.py runserver 0.0.0.0:8000
运行结果及报错内容
Initialize variables...
web_1    | WARNING: No previous model found, starting from clean directory: /root/DeepQA/save/model-server
web_1    | Daemon mode, running in background...
web_1    | Watching for file changes with StatReloader
web_1    | Performing system checks...
web_1    | 
web_1    | System check identified no issues (0 silenced).
web_1    | May 02, 2022 - 09:44:23
web_1    | Django version 2.2.28, using settings 'chatbot_website.settings'
web_1    | Starting ASGI/Channels version 2.4.0 development server at http://0.0.0.0:8000/
web_1    | Quit the server with CONTROL-C.
web_1    | Exception in thread django-main-thread:
web_1    | Traceback (most recent call last):
web_1    |   File "/usr/local/lib/python3.5/site-packages/channels/routing.py", line 29, in get_default_application
web_1    |     module = importlib.import_module(path)
web_1    |   File "/usr/local/lib/python3.5/importlib/__init__.py", line 126, in import_module
web_1    |     return _bootstrap._gcd_import(name[level:], package, level)
web_1    |   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
web_1    |   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
web_1    |   File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
web_1    | ImportError: No module named 'chatbot_website.routing'
web_1    | 
web_1    | During handling of the above exception, another exception occurred:
web_1    | 
web_1    | Traceback (most recent call last):
web_1    |   File "/usr/local/lib/python3.5/threading.py", line 914, in _bootstrap_inner
web_1    |     self.run()
web_1    |   File "/usr/local/lib/python3.5/threading.py", line 862, in run
web_1    |     self._target(*self._args, **self._kwargs)
web_1    |   File "/usr/local/lib/python3.5/site-packages/django/utils/autoreload.py", line 54, in wrapper
web_1    |     fn(*args, **kwargs)
web_1    |   File "/usr/local/lib/python3.5/site-packages/channels/management/commands/runserver.py", line 101, in inner_run
web_1    |     application=self.get_application(options),
web_1    |   File "/usr/local/lib/python3.5/site-packages/channels/management/commands/runserver.py", line 126, in get_application
web_1    |     return StaticFilesWrapper(get_default_application())
web_1    |   File "/usr/local/lib/python3.5/site-packages/channels/routing.py", line 31, in get_default_application
web_1    |     raise ImproperlyConfigured("Cannot import ASGI_APPLICATION module %r" % path)
web_1    | django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'chatbot_website.routing'
我的解答思路和尝试过的方法

我试过修改一些项目要求库的版本,但是任然没有作用

我想要达到的结果

想问一下您是通过什么方法,成功构建DeepQA,并实现web接口。

  • 写回答

1条回答 默认 最新

  • 「已注销」 2022-05-02 19:25
    关注

    部署的是哪个版本的

    评论

报告相同问题?

问题事件

  • 创建了问题 5月2日

悬赏问题

  • ¥15 报酬10000,做一个简单的换汇网站
  • ¥15 关于#vue.js#的问题:word excel和ppt预览问题语言-javascript)
  • ¥15 Apache显示系统错误3该如何解决?
  • ¥30 uniapp小程序苹果手机加载gif图片不显示动效?
  • ¥20 js怎么实现跨域问题
  • ¥15 C++dll二次开发,C#调用
  • ¥15 请教,如何使用C#加载本地摄像头进行逐帧推流
  • ¥15 Python easyocr无法顺利执行,如何解决?
  • ¥15 为什么会突然npm err!啊
  • ¥15 java服务连接es读取列表数据,服务连接本地es获取数据时的速度很快,但是换成远端的es就会非常慢,这是为什么呢