问题遇到的现象和发生背景
你好,我在服务器部署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接口。