質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
nginx

nginixは軽量で高性能なwebサーバーの1つです。BSD-likeライセンスのもとリリースされており、あわせてHTTPサーバ、リバースプロキシ、メールプロキシの機能も備えています。MacOSX、Windows、Linux、上で動作します。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Q&A

解決済

1回答

2505閲覧

uwsgi --ini uwsgi.iniのエラーについて

UekiKouji

総合スコア121

nginx

nginixは軽量で高性能なwebサーバーの1つです。BSD-likeライセンスのもとリリースされており、あわせてHTTPサーバ、リバースプロキシ、メールプロキシの機能も備えています。MacOSX、Windows、Linux、上で動作します。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

0グッド

0クリップ

投稿2017/06/17 06:40

いつもお世話なります。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のパスがおかしいと出ました。色々出たのですが、どれも解決に至りませんでした。
どうしてもわからないので教えてください。お願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

pyenvは非常に便利ですが、きちんと理解して使わないとパスの問題が発生しがちです。
ソースからのインストールか、ius等のリポジトリを使用してインストールを行うことをお勧めします。

投稿2017/06/19 02:38

nasa9084

総合スコア42

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

UekiKouji

2017/06/19 17:13

ありがとうございます。教えていただいた方法でやって見ます。
UekiKouji

2017/06/24 07:51

iusを利用して、1つ1つづつ解決していこうと思います。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問