いつもお世話なります。Centos7の環境構築について質問させてください。
Centos7にpython3.5のインストールしました。
参考元
http://qiita.com/glostuan/items/6030e309542615470e0d
その後、CentOS7 + nginx + uWSGI + Flaskの環境を作っています。
参考元
http://qiita.com/mykysyk@github/items/3ebbd5a787fdbefaf5e8
/var/www/flask/index.wsgi
import sys from flask import Flask sys.path.append('/var/www/flask') application = Flask(__name__) @application.route('/') def index(): return 'HelloWorld'
/etc/nginx/uwsgi.ini
[uwsgi] socket = /var/lib/nginx/tmp/uwsgi/uwsgi.sock python-path = /var/www/flask wsgi-file = /var/www/flask/index.wsgi uid = nginx gid = nginx processes = 4 threads = 2 stats = 127.0.0.1:9191
uwsgi --ini uwsgi.iniのコマンドを打つと以下のエラーになります。
[uWSGI] getting INI configuration from uwsgi.ini *** Starting uWSGI 2.0.15 (64bit) on [Sat Jun 17 07:03:01 2017] *** compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-11) on 17 June 2017 03:56:03 os: Linux-3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Sep 15 15:05:51 UTC 2015 nodename: localhost.localdomain machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 2 current working directory: /etc/nginx detected binary path: /root/.pyenv/versions/3.5.1/bin/uwsgi setgid() to 994 setuid() to 996 your processes number limit is 2390 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to UNIX address /var/lib/nginx/tmp/uwsgi/uwsgi.sock fd 3 Python version: 3.5.1 (default, Jun 17 2017, 03:34:47) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings' Current thread 0x00007f41812ec840 (most recent call first): Aborted
ImportError: No module named 'encodingsエラーで調べると、pythonのパスがおかしいと出ました。色々出たのですが、どれも解決に至りませんでした。
どうしてもわからないので教えてください。お願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/19 17:13
2017/06/24 07:51