Skip to main content

Error devel and gcc

error terjadi ketika ingin install library dengan perintah pip

pip install django-admin

errornya seperti ini

hostname@fedora:/example$ pip3 install django-admin
Defaulting to user installation because normal site-packages is not writeable
Collecting django-admin
Using cached django_admin-2.0.2-py2.py3-none-any.whl.metadata (3.7 kB)
Collecting django-excel-response2>=3.0.0 (from django-admin)
Using cached django_excel_response2-3.0.6-py2.py3-none-any.whl.metadata (4.0 kB)
Collecting django-six (from django-admin)
Using cached django_six-1.0.5-py2.py3-none-any.whl.metadata (794 bytes)
Collecting excel-base>=1.0.3 (from django-excel-response2>=3.0.0->django-admin)
Using cached excel_base-1.0.4-py2.py3-none-any.whl.metadata (1.1 kB)
Collecting xlwt (from excel-base>=1.0.3->django-excel-response2>=3.0.0->django-admin)
Using cached xlwt-1.3.0-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting screen (from excel-base>=1.0.3->django-excel-response2>=3.0.0->django-admin)
Using cached screen-1.0.1.tar.gz (8.6 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting TimeConvert>=1.5.3 (from excel-base>=1.0.3->django-excel-response2>=3.0.0->django-admin)
Using cached TimeConvert-3.0.13-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting isoweek (from TimeConvert>=1.5.3->excel-base>=1.0.3->django-excel-response2>=3.0.0->django-admin)
Using cached isoweek-1.3.3-py2.py3-none-any.whl.metadata (4.4 kB)
Requirement already satisfied: python-dateutil>=2.8.1 in /usr/lib/python3.13/site-packages (from TimeConvert>=1.5.3->excel-base>=1.0.3->django-excel-response2>=3.0.0->django-admin) (2.8.2)
Collecting tzlocal (from TimeConvert>=1.5.3->excel-base>=1.0.3->django-excel-response2>=3.0.0->django-admin)
Using cached tzlocal-5.3.1-py3-none-any.whl.metadata (7.6 kB)
Requirement already satisfied: six>=1.5 in /usr/lib/python3.13/site-packages (from python-dateutil>=2.8.1->TimeConvert>=1.5.3->excel-base>=1.0.3->django-excel-response2>=3.0.0->django-admin) (1.16.0)
Using cached django_admin-2.0.2-py2.py3-none-any.whl (7.6 kB)
Using cached django_excel_response2-3.0.6-py2.py3-none-any.whl (4.9 kB)
Using cached django_six-1.0.5-py2.py3-none-any.whl (2.7 kB)
Using cached excel_base-1.0.4-py2.py3-none-any.whl (5.2 kB)
Using cached TimeConvert-3.0.13-py2.py3-none-any.whl (19 kB)
Using cached isoweek-1.3.3-py2.py3-none-any.whl (7.1 kB)
Using cached tzlocal-5.3.1-py3-none-any.whl (18 kB)
Using cached xlwt-1.3.0-py2.py3-none-any.whl (99 kB)
Building wheels for collected packages: screen
Building wheel for screen (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for screen (pyproject.toml) did not run successfully.
exit code: 1
╰─> [46 lines of output]
/tmp/pip-build-env-4dmdhux_/overlay/lib/python3.13/site-packages/setuptools/dist.py:761: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:

License :: OSI Approved :: BSD License

See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************

!!
self._finalize_license_expression()
running bdist_wheel
The [wheel] section is deprecated. Use [bdist_wheel] instead.
/tmp/pip-build-env-4dmdhux_/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py:135: SetuptoolsDeprecationWarning: bdist_wheel.universal is deprecated
!!

********************************************************************************
With Python 2.7 end-of-life, support for building universal wheels
(i.e., wheels that support both Python 2 and Python 3)
is being obviated.
Please discontinue using this option, or if you still need it,
file an issue with pypa/setuptools describing your use case.

By 2025-Aug-30, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
********************************************************************************

!!
self.finalize_options()
running build
running build_py
creating build/lib.linux-x86_64-cpython-313/screen
copying screen/__init__.py -> build/lib.linux-x86_64-cpython-313/screen
copying screen/compat.py -> build/lib.linux-x86_64-cpython-313/screen
copying screen/old_str_util.py -> build/lib.linux-x86_64-cpython-313/screen
running build_ext
building 'screen.str_util' extension
creating build/temp.linux-x86_64-cpython-313/source
gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -O3 -fPIC -I/usr/include/python3.13 -c source/str_util.c -o build/temp.linux-x86_64-cpython-313/source/str_util.o
source/str_util.c:25:10: fatal error: Python.h: No such file or directory
25 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for screen
Failed to build screen
ERROR: Failed to build installable wheels for some pyproject.toml based projects (screen)

untuk mengatasi error tersebut, jalankan perintah

sudo dnf install python3-devel gcc