Python.h: No such file or directory

When installing the Python library via pip on the openSUSE 42.3 operating system, an error occurs

kiwisolver.cpp:8:20: fatal error: Python.h: No such file or directory
# pip3.4 install matplotlib
Collecting matplotlib
  Using cached https://files.pythonhosted.org/packages/ec/ed/46b835da53b7ed05bd4c6cae293f13ec26e877d2e490a53a709915a9dcb7/matplotlib-2.2.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.1 in /usr/lib64/python3.4/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): cycler>=0.10 in /usr/lib/python3.4/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/lib/python3.4/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil>=2.1 in /usr/lib/python3.4/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pytz in /usr/lib/python3.4/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): six>=1.10 in /usr/lib/python3.4/site-packages (from matplotlib)
Collecting kiwisolver>=1.0.1 (from matplotlib)
  Using cached https://files.pythonhosted.org/packages/31/60/494fcce70d60a598c32ee00e71542e52e27c978e5f8219fae0d4ac6e2864/kiwisolver-1.0.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python3.4/site-packages (from kiwisolver>=1.0.1->matplotlib)
Installing collected packages: kiwisolver, matplotlib
  Running setup.py install for kiwisolver
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-2dpyp8ww/kiwisolver/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-y_1l5ue7-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'kiwisolver' extension
    creating build
    creating build/temp.linux-x86_64-3.4
    creating build/temp.linux-x86_64-3.4/py
    gcc -pthread -Wno-unused-result -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -DOPENSSL_LOAD_CONF -fPIC -I. -I/usr/include/python3.4m -c py/kiwisolver.cpp -o build/temp.linux-x86_64-3.4/py/kiwisolver.o
    py/kiwisolver.cpp:8:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-2dpyp8ww/kiwisolver/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-y_1l5ue7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-2dpyp8ww/kiwisolver
Author: MarianD, 2018-06-29

1 answers

Reinstalling python3-devel helped(I removed it via zypper and installed it from the rpm package from here: https://opensuse.pkgs.org/42.3/opensuse-update-oss/python3-devel-3.4.6-12.3.1.x86_64.rpm.html via Yast)

 2
Author: Vladimir Kurbatov, 2018-07-02 05:36:30