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

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

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

DjangoはPythonで書かれた、オープンソースウェブアプリケーションのフレームワークです。複雑なデータベースを扱うウェブサイトを開発する際に必要な労力を減らす為にデザインされました。

Python 3.x

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

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Q&A

解決済

1回答

2986閲覧

Ubuntuにmod_wsgiを入れようとしたらエラーが発生した

cometbeet

総合スコア21

Django

DjangoはPythonで書かれた、オープンソースウェブアプリケーションのフレームワークです。複雑なデータベースを扱うウェブサイトを開発する際に必要な労力を減らす為にデザインされました。

Python 3.x

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

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

0グッド

0クリップ

投稿2019/03/01 09:21

編集2019/03/01 09:26

現在WSLのUbuntuでlampを立てているところにpythonを動かせるようDjangoを入れてみようとしています。
そこの途中でpip install mod_wsgiをしたのですがそこがうまくいきません。
最後にgccがなにやら出ていますがgccは入っています。
またsetuptoolsも一度アンインストールしてから入れなおしました。
エラー内容は量が多すぎたため一部削っているので必要な場合は追加します。
どう対処したらよいかわからないのでよろしくお願いします。

エラー内容

... WARNING: The Python installation you are using does not appear to have been installed with a shared library, or in the case of MacOS X, as a framework. Where these are not present, the compilation of mod_wsgi may fail, or if it does succeed, will result in extra memory being used by all processes at run time as a result of the static library needing to be loaded in its entirety to every process. It is highly recommended that you reinstall the Python installation being used from source code, supplying the '--enable-shared' option to the 'configure' script when configuring the source code prior to building and installing it. /home/ユーザー名/.pyenv/versions/3.7.2/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'bugtrack_url' warnings.warn(msg) ... gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_daemon.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_daemon.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_interp.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_interp.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_logger.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_logger.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include src/server/wsgi_logger.c: In function ‘wsgi_log_python_error’: src/server/wsgi_logger.c:697:33: warning: variable ‘thread_info’ set but not used [-Wunused-but-set-variable] WSGIThreadInfo *thread_info; ^ gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_memory.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_memory.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_metrics.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_metrics.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_restrict.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_restrict.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_server.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_server.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_stream.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_stream.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_thread.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_thread.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/apache2 -I/home/ユーザー名/.pyenv/versions/3.7.2/include/python3.7m -c src/server/wsgi_validate.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_validate.o -I/usr/include/apache2 -I. -I/usr/include/apr-1.0 -I/usr/include -DBUILD_DATETIME='"2018-06-07T19:43:03"' -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include gcc -pthread -shared -L/home/ユーザー名/.pyenv/versions/3.7.2/lib -L/home/ユーザー名/.pyenv/versions/3.7.2/lib build/temp.linux-x86_64-3.7/src/server/mod_wsgi.o build/temp.linux-x86_64-3.7/src/server/wsgi_apache.o build/temp.linux-x86_64-3.7/src/server/wsgi_buckets.o build/temp.linux-x86_64-3.7/src/server/wsgi_convert.o build/temp.linux-x86_64-3.7/src/server/wsgi_daemon.o build/temp.linux-x86_64-3.7/src/server/wsgi_interp.o build/temp.linux-x86_64-3.7/src/server/wsgi_logger.o build/temp.linux-x86_64-3.7/src/server/wsgi_memory.o build/temp.linux-x86_64-3.7/src/server/wsgi_metrics.o build/temp.linux-x86_64-3.7/src/server/wsgi_restrict.o build/temp.linux-x86_64-3.7/src/server/wsgi_server.o build/temp.linux-x86_64-3.7/src/server/wsgi_stream.o build/temp.linux-x86_64-3.7/src/server/wsgi_thread.o build/temp.linux-x86_64-3.7/src/server/wsgi_validate.o -o build/lib.linux-x86_64-3.7/mod_wsgi/server/mod_wsgi-py37.cpython-37m-x86_64-linux-gnu.so -L/home/ユーザー名/.pyenv/versions/3.7.2/lib -L/home/ユーザー名/.pyenv/versions/3.7.2/lib/python3.7/config-3.7m-linux -lpython3.7m /usr/bin/ld: /home/ユーザー名/.pyenv/versions/3.7.2/lib/libpython3.7m.a(abstract.o): 再配置 R_X86_64_32S (`_Py_NotImplementedStruct' に対する) は共有オブジェクト作成時には使用 できません。-fPIC を付けて再コンパイルしてください。 /home/ユーザー名/.pyenv/versions/3.7.2/lib/libpython3.7m.a: error adding symbols: 不正な値です collect2: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1 ---------------------------------------- Command "/home/ユーザー名/.pyenv/versions/3.7.2/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-u595aw0n/mod-wsgi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-9tk4kd3e/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-u595aw0n/mod-wsgi/

##環境
OS:Windows10 pro
WSL:Ubunutu 16.04.6
python:pyenvを使っており、現在はpython3.7.2です
gcc:gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
setuptools:40.8.0
pip:19.0.3

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

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

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

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

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

guest

回答1

0

自己解決

まだ検索力が足りなかったらしく以下のサイトを参考にしたらできました。
http://t44or2.hatenablog.com/entry/2018/11/04/mod_wsgi_%E3%81%8C%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%A7%E3%81%8D%E3%81%AA%E3%81%84
同じように
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.7.2
としてからpip install mod_wsgiをすると

$ pip install mod_wsgi Collecting mod_wsgi Using cached https://files.pythonhosted.org/packages/47/69/5139588686eb40053f8355eba1fe18a8bee94dc3efc4e36720c73e07471a/mod_wsgi-4.6.5.tar.gz Building wheels for collected packages: mod-wsgi Building wheel for mod-wsgi (setup.py) ... done Stored in directory: /home/ユーザー名/.cache/pip/wheels/28/f2/06/a35ecac864a04a754d59ea59e44bf92ba4f50b2c1857491186 Successfully built mod-wsgi Installing collected packages: mod-wsgi Successfully installed mod-wsgi-4.6.5

となり無事インストールされました。

pyenv使わない状態のpythonがあったほうがいいってことなのでしょうか?

投稿2019/03/01 09:57

cometbeet

総合スコア21

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.49%

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

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

質問する

関連した質問