如何解决“没有名为myModule的模块”问题

时间:2020-06-09 09:35:26

标签: django python-3.6 python-3.7 gunicorn pymysql

The code structure

代码结构如下图

https://www.sdpjw.cn/uploadFile/draft/2020/python.png

启动服务时,如命令'gunicorn -w 4 -b 0.0.0.0:8000 ApiWangYinParse:server',它显示错误日志。

plz看一下代码结构,我可以用什么命令启动python服务。

[2020-06-09 17:24:20 +0800] [28785] [INFO] Starting gunicorn 20.0.4
[2020-06-09 17:24:20 +0800] [28785] [INFO] Listening at: http://0.0.0.0:8000 (28785)
[2020-06-09 17:24:20 +0800] [28785] [INFO] Using worker: sync
[2020-06-09 17:24:20 +0800] [28788] [INFO] Booting worker with pid: 28788
[2020-06-09 17:24:20 +0800] [28789] [INFO] Booting worker with pid: 28789
[2020-06-09 17:24:20 +0800] [28788] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/signdraft2/ShenDuTool/API/ApiWangYinParse.py", line 6, in <module>
    from WangYinParse.MinSheng import MinShengParse as MSP;
ModuleNotFoundError: No module named 'WangYinParse'

0 个答案:

没有答案