I have been handed an issue with our company as I have been deemed the “Linux Expert” so I can fix anything…ha.
We are trying to install GIT on a RHEL 9 server and ran into an issue with pip install not working correctly. I have no experience with Python or PIP, but none the less, I have been given the task to figure this out.
When running 'python -m pip install ‘uwsgi==2.0.*’ I get a bunch of errors:
> [root@LOCALHOST ~]# python -m pip install 'uwsgi==2.0.*'
> Collecting uwsgi==2.0.*
> Using cached uwsgi-2.0.21.tar.gz (808 kB)
> Building wheels for collected packages: uwsgi
> Building wheel for uwsgi (setup.py) ... error
> ERROR: Command errored out with exit status 1:
> command: /usr/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-w1mn136t
> cwd: /tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/
> Complete output (42 lines):
> /usr/lib64/python3.9/distutils/dist.py:274: 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-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/uwsgiconfig.py", line 750, 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-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py", line 117, in <module>
> setup(
> File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
> return distutils.core.setup(**attrs)
> File "/usr/lib64/python3.9/distutils/core.py", line 148, in setup
> dist.run_commands()
> File "/usr/lib64/python3.9/distutils/dist.py", line 966, in run_commands
> self.run_command(cmd)
> File "/usr/lib64/python3.9/distutils/dist.py", line 985, in run_command
> cmd_obj.run()
> File "/usr/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 335, in run
> self.run_command('install')
> File "/usr/lib64/python3.9/distutils/cmd.py", line 313, in run_command
> self.distribution.run_command(command)
> File "/usr/lib64/python3.9/distutils/dist.py", line 985, in run_command
> cmd_obj.run()
> File "/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py", line 77, in run
> conf = uc.uConf(get_profile())
> File "/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/uwsgiconfig.py", line 758, in __init__
> raise Exception("you need a C compiler to build uWSGI")
> Exception: you need a C compiler to build uWSGI
> ----------------------------------------
> ERROR: 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
> ERROR: Command errored out with exit status 1:
> command: /usr/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9fu0vfcv/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/uwsgi
> cwd: /tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/
> Complete output (29 lines):
> /usr/lib64/python3.9/distutils/dist.py:274: 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-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/uwsgiconfig.py", line 750, 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-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py", line 117, in <module>
> setup(
> File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
> return distutils.core.setup(**attrs)
> File "/usr/lib64/python3.9/distutils/core.py", line 148, in setup
> dist.run_commands()
> File "/usr/lib64/python3.9/distutils/dist.py", line 966, in run_commands
> self.run_command(cmd)
> File "/usr/lib64/python3.9/distutils/dist.py", line 985, in run_command
> cmd_obj.run()
> File "/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py", line 77, in run
> conf = uc.uConf(get_profile())
> File "/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/uwsgiconfig.py", line 758, in __init__
> raise Exception("you need a C compiler to build uWSGI")
> Exception: you need a C compiler to build uWSGI
> ----------------------------------------
> ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uuoplc2k/uwsgi_a522fa146829432e8030b57e1a1515c3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9fu0vfcv/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/uwsgi Check the logs for full command output.
I have tried finding logs for hopefully finding what is causing this error with no luck. I really have no idea from this message what I need to be searching for in order to help understand this error.