글 수정 예정
aws ec2를 사용하다 해당 에러가 나왔다
에러 전문
Collecting uwsgi
Downloading https://files.pythonhosted.org/packages/c7/75/45234f7b441c59b1eefd31ba3d1041a7e3c89602af24488e2a22e11e7259/uWSGI-2.0.19.1.tar.gz (803kB)
100% |████████████████████████████████| 808kB 997kB/s
Building wheels for collected packages: uwsgi
Running setup.py bdist_wheel for uwsgi ... error
Complete output from command /home/ubuntu/myvenv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-960f4exl/uwsgi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpnu92y8ripip-wheel- --python-tag cp36:
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'descriptions'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib
copying uwsgidecorators.py -> build/lib
installing to build/bdist.linux-x86_64/wheel
running install
using profile: buildconf/default.ini
detected include path: ['/usr/include', '/usr/local/include']
Traceback (most recent call last):
File "/tmp/pip-build-960f4exl/uwsgi/uwsgiconfig.py", line 747, in __init__
gcc_version_components = gcc_version.split('.')
AttributeError: 'NoneType' object has no attribute 'split'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-960f4exl/uwsgi/setup.py", line 140, in <module>
'Programming Language :: Python :: 3.8',
File "/home/ubuntu/myvenv/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/ubuntu/myvenv/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 326, in run
self.run_command('install')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-960f4exl/uwsgi/setup.py", line 77, in run
conf = uc.uConf(get_profile())
File "/tmp/pip-build-960f4exl/uwsgi/uwsgiconfig.py", line 755, 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
Running setup.py clean for uwsgi
Failed to build uwsgi
Installing collected packages: uwsgi
Running setup.py install for uwsgi ... error
Complete output from command /home/ubuntu/myvenv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-960f4exl/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-yd21s993-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/myvenv/include/site/python3.6/uwsgi:
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'descriptions'
warnings.warn(msg)
running install
using profile: buildconf/default.ini
detected include path: ['/usr/include', '/usr/local/include']
Traceback (most recent call last):
File "/tmp/pip-build-960f4exl/uwsgi/uwsgiconfig.py", line 747, in __init__
gcc_version_components = gcc_version.split('.')
AttributeError: 'NoneType' object has no attribute 'split'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-960f4exl/uwsgi/setup.py", line 140, in <module>
'Programming Language :: Python :: 3.8',
File "/home/ubuntu/myvenv/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-960f4exl/uwsgi/setup.py", line 77, in run
conf = uc.uConf(get_profile())
File "/tmp/pip-build-960f4exl/uwsgi/uwsgiconfig.py", line 755, in __init__
raise Exception("you need a C compiler to build uWSGI")
Exception: you need a C compiler to build uWSGI
----------------------------------------
Command "/home/ubuntu/myvenv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-960f4exl/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-yd21s993-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/myvenv/include/site/python3.6/uwsgi" failed with error code 1 in /tmp/pip-build-960f4exl/uwsgi/
해당 게시글을 보며 해결하였습니다.
저의 python version은 3.6.9
# python의 개발도구를 가져옵니다.
sudo add-apt-repository ppa:deadsnakes/ppa
# 패키지 목록 업데이트
sudo apt-get update
# python 개발도구 설치
sudo apt-get install build-essential python3.6-dev
# uwsgi 설치
pip install uwsgi
-끝-