sumerc / yappi

Yet Another Python Profiler, but this time multithreading, asyncio and gevent aware.
MIT License
1.44k stars 72 forks source link

Not able to install yappi in ubuntu 18.04 using pip #99

Closed ms1596 closed 2 years ago

ms1596 commented 2 years ago

Screenshot from 2022-05-13 23-28-12

ms1596 commented 2 years ago

Full Stack Trace

Collecting yappi
  Downloading yappi-1.3.3.tar.gz (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.9/58.9 KB 551.6 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: yappi
  Building wheel for yappi (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      /tmp/timer_create2atzytry.c: In function ‘main’:
      /tmp/timer_create2atzytry.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
           timer_create();
           ^~~~~~~~~~~~
      /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      copying yappi/yappi.py -> build/lib.linux-x86_64-3.8
      running build_ext
      building '_yappi' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/yappi
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DLIB_RT_AVAILABLE=1 -I/home/elucidata/ELUCIDATA/libraries/polly-python-env/include -I/usr/include/python3.8 -c yappi/_yappi.c -o build/temp.linux-x86_64-3.8/yappi/_yappi.o
      In file included from yappi/_yappi.c:10:0:
      yappi/config.h:4:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for yappi
  Running setup.py clean for yappi
Failed to build yappi
Installing collected packages: yappi
  Running setup.py install for yappi ... error
  error: subprocess-exited-with-error

  × Running setup.py install for yappi did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      /tmp/timer_create4ww2hngm.c: In function ‘main’:
      /tmp/timer_create4ww2hngm.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
           timer_create();
           ^~~~~~~~~~~~
      /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
        warnings.warn(msg)
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      copying yappi/yappi.py -> build/lib.linux-x86_64-3.8
      running build_ext
      building '_yappi' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/yappi
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DLIB_RT_AVAILABLE=1 -I/home/elucidata/ELUCIDATA/libraries/polly-python-env/include -I/usr/include/python3.8 -c yappi/_yappi.c -o build/temp.linux-x86_64-3.8/yappi/_yappi.o
      In file included from yappi/_yappi.c:10:0:
      yappi/config.h:4:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> yappi

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the '/home/elucidata/ELUCIDATA/libraries/polly-python-env/bin/python -m pip install --upgrade pip' command.
(polly-python-env) ➜  polly-python-code git:(ftr_code_structure_improvements) ✗ 
(polly-python-env) ➜  polly-python-code git:(ftr_code_structure_improvements) ✗ yappi --version
zsh: command not found: yappi
(polly-python-env) ➜  polly-python-code git:(ftr_code_structure_improvements) ✗ pip install yappi
Collecting yappi
  Using cached yappi-1.3.3.tar.gz (58 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: yappi
  Building wheel for yappi (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      /tmp/timer_createxn97eyw_.c: In function ‘main’:
      /tmp/timer_createxn97eyw_.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
           timer_create();
           ^~~~~~~~~~~~
      /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      copying yappi/yappi.py -> build/lib.linux-x86_64-3.8
      running build_ext
      building '_yappi' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/yappi
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DLIB_RT_AVAILABLE=1 -I/home/elucidata/ELUCIDATA/libraries/polly-python-env/include -I/usr/include/python3.8 -c yappi/_yappi.c -o build/temp.linux-x86_64-3.8/yappi/_yappi.o
      In file included from yappi/_yappi.c:10:0:
      yappi/config.h:4:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for yappi
  Running setup.py clean for yappi
Failed to build yappi
Installing collected packages: yappi
  Running setup.py install for yappi ... error
  error: subprocess-exited-with-error

  × Running setup.py install for yappi did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      /tmp/timer_createlf11iuow.c: In function ‘main’:
      /tmp/timer_createlf11iuow.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
           timer_create();
           ^~~~~~~~~~~~
      /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
        warnings.warn(msg)
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      copying yappi/yappi.py -> build/lib.linux-x86_64-3.8
      running build_ext
      building '_yappi' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/yappi
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DLIB_RT_AVAILABLE=1 -I/home/elucidata/ELUCIDATA/libraries/polly-python-env/include -I/usr/include/python3.8 -c yappi/_yappi.c -o build/temp.linux-x86_64-3.8/yappi/_yappi.o
      In file included from yappi/_yappi.c:10:0:
      yappi/config.h:4:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> yappi

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the '/home/elucidata/ELUCIDATA/libraries/polly-python-env/bin/python -m pip install --upgrade pip' command.
(polly-python-env) ➜  polly-python-code git:(ftr_code_structure_improvements) ✗ 
(polly-python-env) ➜  polly-python-code git:(ftr_code_structure_improvements) ✗ pip install git+https://github.com/sumerc/yappi#egg=yappi
Collecting yappi
  Cloning https://github.com/sumerc/yappi to /tmp/pip-install-2mebuv82/yappi_e621118c961949188dd66ecd552ef5ac
  Running command git clone --filter=blob:none --quiet https://github.com/sumerc/yappi /tmp/pip-install-2mebuv82/yappi_e621118c961949188dd66ecd552ef5ac
  Resolved https://github.com/sumerc/yappi to commit 513513c8871f1dbdaa401cecd756254a160b2feb
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: yappi
  Building wheel for yappi (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      /tmp/timer_createe2m5e13v.c: In function ‘main’:
      /tmp/timer_createe2m5e13v.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
           timer_create();
           ^~~~~~~~~~~~
      /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      copying yappi/yappi.py -> build/lib.linux-x86_64-3.8
      running build_ext
      building '_yappi' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/yappi
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DLIB_RT_AVAILABLE=1 -I/home/elucidata/ELUCIDATA/libraries/polly-python-env/include -I/usr/include/python3.8 -c yappi/_yappi.c -o build/temp.linux-x86_64-3.8/yappi/_yappi.o
      In file included from yappi/_yappi.c:10:0:
      yappi/config.h:4:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for yappi
  Running setup.py clean for yappi
Failed to build yappi
Installing collected packages: yappi
  Running setup.py install for yappi ... error
  error: subprocess-exited-with-error

  × Running setup.py install for yappi did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      /tmp/timer_createoqr4yknp.c: In function ‘main’:
      /tmp/timer_createoqr4yknp.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
           timer_create();
           ^~~~~~~~~~~~
      /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
        warnings.warn(msg)
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      copying yappi/yappi.py -> build/lib.linux-x86_64-3.8
      running build_ext
      building '_yappi' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/yappi
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DLIB_RT_AVAILABLE=1 -I/home/elucidata/ELUCIDATA/libraries/polly-python-env/include -I/usr/include/python3.8 -c yappi/_yappi.c -o build/temp.linux-x86_64-3.8/yappi/_yappi.o
      In file included from yappi/_yappi.c:10:0:
      yappi/config.h:4:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> yappi

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
sumerc commented 2 years ago

Hi,

Yappi currently does not have binary distribution. So, it needs to be compiled on the platform during installation.

The error you get is because the python-dev package which is needed to compile yappi is not installed in the system:

yappi/config.h:4:10: fatal error: Python.h: No such file or directory

Just install python-dev package and it should work just fine.