junzis / pyModeS

Python decoder for Mode S and ADS-B signals
GNU General Public License v3.0
527 stars 151 forks source link

Installation Error on Ubuntu 18.04.6 #148

Closed sitoras closed 1 year ago

sitoras commented 1 year ago

I was trying to install pyModeS on Ubuntu and got this error. I updated the system and all necessary packages. I would appreciate any suggestion to solve this problem.

pip install pyModeS
Defaulting to user installation because normal site-packages is not writeable
Collecting pyModeS
  Using cached pymodes-2.16.tar.gz (63 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy<2.0,>=1.24 in ./.local/lib/python3.9/site-packages (from pyModeS) (1.24.3)
Collecting pyzmq<25.0,>=24.0 (from pyModeS)
  Using cached pyzmq-24.0.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB)
Building wheels for collected packages: pyModeS
  Building wheel for pyModeS (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyModeS (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [57 lines of output]
      Compiling pyModeS/c_common.pyx because it changed.
      Compiling pyModeS/decoder/flarm/decode.pyx because it changed.
      [1/2] Cythonizing pyModeS/c_common.pyx
      [2/2] Cythonizing pyModeS/decoder/flarm/decode.pyx
      pyModeS/c_common.c:23:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      Traceback (most recent call last):
        File "/usr/lib/python3.9/distutils/unixccompiler.py", line 117, in _compile
          self.spawn(compiler_so + cc_args + [src, '-o', obj] +
        File "/usr/lib/python3.9/distutils/ccompiler.py", line 910, in spawn
          spawn(cmd, dry_run=self.dry_run)
        File "/usr/lib/python3.9/distutils/spawn.py", line 91, in spawn
          raise DistutilsExecError(
      distutils.errors.DistutilsExecError: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/tmp/pip-install-xyypbrv4/pymodes_989f13611a554e4dad809328e7ddd903/build.py", line 69, in <module>
          build()
        File "/tmp/pip-install-xyypbrv4/pymodes_989f13611a554e4dad809328e7ddd903/build.py", line 57, in build
          cmd.run()
        File "/usr/lib/python3.9/distutils/command/build_ext.py", line 340, in run
          self.build_extensions()
        File "/usr/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
          self._build_extensions_serial()
        File "/usr/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
          self.build_extension(ext)
        File "/usr/lib/python3.9/distutils/command/build_ext.py", line 529, in build_extension
          objects = self.compiler.compile(sources,
        File "/usr/lib/python3.9/distutils/ccompiler.py", line 574, in compile
          self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
        File "/usr/lib/python3.9/distutils/unixccompiler.py", line 120, in _compile
          raise CompileError(msg)
      distutils.errors.CompileError: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      Traceback (most recent call last):
        File "/home/sceccone/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/sceccone/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/sceccone/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-wdq1yini/overlay/lib/python3.9/site-packages/poetry/core/masonry/api.py", line 57, in build_wheel
          return WheelBuilder.make_in(
        File "/tmp/pip-build-env-wdq1yini/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 86, in make_in
          wb.build(target_dir=directory)
        File "/tmp/pip-build-env-wdq1yini/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 121, in build
          self._build(zip_file)
        File "/tmp/pip-build-env-wdq1yini/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 170, in _build
          self._run_build_script(self._package.build_script)
        File "/tmp/pip-build-env-wdq1yini/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 230, in _run_build_script
          subprocess.check_call([self.executable.as_posix(), build_script])
        File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/usr/bin/python3', 'build.py']' returned non-zero 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 pyModeS
Failed to build pyModeS
ERROR: Could not build wheels for pyModeS, which is required to install pyproject.toml-based projects
xoolive commented 1 year ago

You need to install libpython-dev with apt

sitoras commented 1 year ago

You need to install libpython-dev with apt

Yes, I did, but it didn't solve the problem. I still have this error.

sitoras commented 1 year ago

You need to install libpython-dev with apt

Thank you! I tried installing libpython-dev again for the specific Python version I'm using and it solved the problem. I appreciate your help!