I installed uwsgi on my EC2 instance and it failed, so Troubleshooting notes
Originally, I made a web application using the python framework "Django". When I try to run it on EC2 with nginx + wsgi, it feels like an error occurred during installation. I have no development experience, so why did you try to work with that specification? If you get stuck in (No particular reason) I think I will answer, but I will refer to it if you comment.
So install it on your EC2 instance
pip install uwsgi
When I tried, I got an error like this.
Traceback (most recent call last): File "
", line 1, in File "/tmp/pip-build-pV1pAc/uwsgi/setup.py", line 124, in distclass=uWSGIDistribution, File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup dist.run_commands() File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 215, in run self.run_command('install') File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/tmp/pip-build-pV1pAc/uwsgi/setup.py", line 77, in run conf = uc.uConf(get_profile()) File "uwsgiconfig.py", line 742, in init raise Exception("you need a C compiler to build uWSGI") Exception: you need a C compiler to build uWSGI
Failed building wheel for uwsgi
I need a C compiler! I got angry. Now let's use the C compiler.
And I tried google.
As a result, I didn't have the Development Tool installed, so Let's install it.
sudo yum groupinstall "Development Tools"
You can now install it. So install it again.
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>
Compiling has stopped.
Wow. .. .. Really? .. .. I was angry that there was no file, so I googled again. Reference article: http://zashikiro.hateblo.jp/entry/2012/10/02/130031
So, I installed a package called python2.7-dev.
sudo yum install python-devel
You should now be able to see Python.h.
Let's try again.
Then. .. ..
Collecting uwsgi Using cached uwsgi-2.0.14.tar.gz Building wheels for collected packages: uwsgi Running setup.py bdist_wheel for uwsgi ... done Stored in directory: /root/.cache/pip/wheels/c4/ad/56/f70a70b63fa4b0f2c0518db6f41381c9d33cd5cc5ac9a9494b Successfully built uwsgi Installing collected packages: uwsgi Successfully installed uwsgi-2.0.14
I was able to install it! You did it!
So let's try to deploy this time ~
Recommended Posts