まず、私は多くの関連する質問があることを認識していますが、誰も私の問題を解決しませんでした。 私のvirtualenvがアクティブになったときにcentOSs 7にsudo pip3 install uwsgi
を使用してuwsgiをインストールしました。私はこれは私のashpazi.ini
ファイルdjango uwsgi no moduleという名前のサイト
which uwsgi
戻り
/usr/bin/uwsgi
を実行
[uwsgi]
chdir = /root/projects/ashpazi
home = /root/projects/venv
module = ashpazi.wsgi:application
master = true
processes = 5
uid = root
gid = nginx
env = DJANGO_SETTINGS_MODULE=ashpazi.settings
plugin = python3.6
socket = /root/projects/sockets/ashapazi.sock
chmod-socket = 777
vacuum = true
ある
ImportError: No module named site
このエラーを取得するコマンドで
uwsgi --http :8000 --module ashpazi.wsgi --ini ../ini_files/ashpazi.ini
それを実行してみてください。
そしてsudo pip3 show uwsgi
戻り、この実行している:
Name: uWSGI
Version: 2.0.15
Summary: The uWSGI server
Home-page: https://uwsgi-docs.readthedocs.io/en/latest/
Author: Unbit
Author-email: [email protected]
License: GPL2
Location: /usr/lib/python2.7/site-packages
uwsgiが
python2.7
フォルダ内にあると述べて
と私は私のDjangoのプロジェクトで使用していないpython3.6
を。 この問題を解決するにはどうすればよいですか?
編集:
sudoをせずにそれを使用して
*** uWSGI compiling embedded plugins ***
[gcc -pthread] plugins/python/python_plugin.o
In file included from plugins/python/python_plugin.c:1:0:
plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file
or directory
#include <Python.h>
^
compilation terminated.
----------------------------------------
Command "/root/projects/venv/bin/python3.6 -u -c "import setuptools,
tokenize;__file__='/tmp/pip-build-
yz2o1zz3/uwsgi/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-o6hcf_v3-record/install-record.txt --single-version-
externally-managed --compile --install-headers
/root/projects/venv/include/site/python3.6/uwsgi" failed with error
code 1 in /tmp/pip-build-yz2o1zz3/uwsgi/
エラーメッセージのトレースバックを共有することができます –
virtualenvにインストールするときに '' sudo pip3 install uwsgi''を使用しないでください。 virtualenvを有効にした後、 '' pip install uwsgi''だけを使用してください。あなたがしたことをやって、それをシステムPythonにインストールしました。 –
@GrahamDumpletonあなたはpip3がシステムにインストールする理由をお知らせください。pipはvenv –