Flaskで作ったアプリをuwsgiを使って動かしたいときに、以下のエラーメッセージが出て、なかなか進みません。
terminal
1*** Starting uWSGI 2.0.19.1 (64bit) on [Mon Mar 8 12:26:42 2021] *** 2compiled with version: Apple LLVM 12.0.0 (clang-1200.0.26.2) on 27 February 2021 00:45:06 3os: Darwin-20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 4nodename: suzukihchinoMBP.AirPort 5machine: x86_64 6clock source: unix 7detected number of CPU cores: 8 8current working directory: /Users/suzukiharumasaru/Desktop/animal 9detected binary path: /opt/anaconda3/envs/flask/bin/uwsgi 10!!! no internal routing support, rebuild with pcre support !!! 11*** WARNING: you are running uWSGI without its master process manager *** 12your processes number limit is 2784 13your memory page size is 4096 bytes 14detected max file descriptor number: 256 15lock engine: OSX spinlocks 16thunder lock: disabled (you can enable it with --thunder-lock) 17uWSGI http bound on 0.0.0.0:6700 fd 4 18spawned uWSGI http 1 (pid: 29591) 19uwsgi socket 0 bound to TCP address 127.0.0.1:49313 (port auto-assigned) fd 3 20Python version: 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ] 21*** Python threads support is disabled. You can enable it with --enable-threads *** 22Python main interpreter initialized at 0x7fdd01d05b20 23your server socket listen backlog is limited to 100 connections 24your mercy for graceful operations on workers is 60 seconds 25mapped 72896 bytes (71 KB) for 1 cores 26*** Operational MODE: single process *** 27Traceback (most recent call last): 28 File "hello.py", line 1, in <module> 29 from flask import Flask 30 File "/opt/anaconda3/envs/flask/lib/python3.8/site-packages/flask/__init__.py", line 14, in <module> 31 from jinja2 import escape 32 File "/opt/anaconda3/envs/flask/lib/python3.8/site-packages/jinja2/__init__.py", line 9, in <module> 33 from .bccache import BytecodeCache 34 File "/opt/anaconda3/envs/flask/lib/python3.8/site-packages/jinja2/bccache.py", line 14, in <module> 35 import tempfile 36 File "/opt/anaconda3/envs/flask/lib/python3.8/tempfile.py", line 45, in <module> 37 from random import Random as _Random 38 File "/opt/anaconda3/envs/flask/lib/python3.8/random.py", line 41, in <module> 39 from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil 40ImportError: dlopen(/opt/anaconda3/envs/flask/lib/python3.8/lib-dynload/math.cpython-38-darwin.so, 2): Symbol not found: _PyExc_MemoryError 41 Referenced from: /opt/anaconda3/envs/flask/lib/python3.8/lib-dynload/math.cpython-38-darwin.so 42 Expected in: flat namespace 43 in /opt/anaconda3/envs/flask/lib/python3.8/lib-dynload/math.cpython-38-darwin.so 44unable to load app 0 (mountpoint='') (callable not found or import error) 45*** no app loaded. going in full dynamic mode *** 46*** uWSGI is running in multiple interpreter mode *** 47spawned uWSGI worker 1 (and the only) (pid: 29589, cores: 1)
さまざまなサイトを参照してもなかなか解決しません。
動かそうとしているファイル(hello.py)は以下になります。
このファイルは、Desktopのanimalと言うファイルに入っています。
コードは以下になります。
よろしくお願いします。
python
1from flask import Flask 2app = Flask(__name__) 3 4 5@app.route('/') 6def hello_world(): 7 return 'Hello, World!' 8 9 10if __name__== "__main__": 11 app.run() 12else: 13 application = app