junzis / pyModeS

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

Unable to install with Pip on arm64 Ubuntu Server 20 (BananaPi-M5) #138

Closed jonrau1 closed 1 year ago

jonrau1 commented 1 year ago

Unsure how this may relate to #137 as far as a fix goes, but using Pip3 I am getting an unhelpful error I assume is because of arm64, but it could be something else. This is a freshly updated image from here:

2021-06-21 release, Ubuntu Server 20.04 with kernel 4.9.241
Baidu Cloud: https://pan.baidu.com/s/1IAugHTujzkTV9zfQoLw-iA?pwd=a37k (pincode: a37k)
Google Drive:https://drive.google.com/file/d/1ASyBYkQmv6RMg_NSf2KQTpd87PosyeW-/view?usp=sharing
MD5: 5c896c37eaa590cfbb8a6c7a5ba433a0

In the off chance there is something else I can do, I am all (virtual) ears

Some host info

pi@ubuntu:~$ uname -a
Linux ubuntu 4.9.241-BPI-M5 #2 SMP PREEMPT Mon Jun 21 16:29:40 HKT 2021 aarch64 aarch64 aarch64 GNU/Linux
pi@ubuntu:~$ python3 --version
Python 3.8.10

Error from Pip3

pi@ubuntu:~$ pip3 install pyModeS
Collecting pyModeS
  Using cached pymodes-2.14.tar.gz (392 kB)
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 186, in _main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 357, in run
    resolver.resolve(requirement_set)
  File "/usr/lib/python3/dist-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/usr/lib/python3/dist-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/lib/python3/dist-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(req)
  File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 515, in prepare_linked_requirement
    abstract_dist = _get_prepared_distribution(
  File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 95, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(finder, build_isolation)
  File "/usr/lib/python3/dist-packages/pip/_internal/distributions/sdist.py", line 33, in prepare_distribution_metadata
    self.req.load_pyproject_toml()
  File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 512, in load_pyproject_toml
    pyproject_toml_data = load_pyproject_toml(
  File "/usr/lib/python3/dist-packages/pip/_internal/pyproject.py", line 75, in load_pyproject_toml
    pp_toml = toml.load(f)
  File "/usr/share/python-wheels/toml-0.10.0-py2.py3-none-any.whl/toml/decoder.py", line 134, in load
    return loads(f.read(), _dict, decoder)
  File "/usr/share/python-wheels/toml-0.10.0-py2.py3-none-any.whl/toml/decoder.py", line 455, in loads
    ret = decoder.load_line(line, currentlevel, multikey,
  File "/usr/share/python-wheels/toml-0.10.0-py2.py3-none-any.whl/toml/decoder.py", line 725, in load_line
    value, vtype = self.load_value(pair[1], strictly_valid)
  File "/usr/share/python-wheels/toml-0.10.0-py2.py3-none-any.whl/toml/decoder.py", line 802, in load_value
    return (self.load_array(v), "array")
  File "/usr/share/python-wheels/toml-0.10.0-py2.py3-none-any.whl/toml/decoder.py", line 914, in load_array
    a[b] = a[b] + ',' + a[b + 1]
IndexError: list index out of range
xoolive commented 1 year ago

Could you confirm your pip version?

jonrau1 commented 1 year ago

Hey @xoolive it's pip 22.3.1 from /home/pi/.local/lib/python3.8/site-packages/pip (python 3.8)

jonrau1 commented 1 year ago

Did a restart and got a different error this time

pi@ubuntu:~$ pip3 install pyModeS
Defaulting to user installation because normal site-packages is not writeable
Collecting pyModeS
  Using cached pymodes-2.14.tar.gz (392 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pyzmq<25.0,>=24.0
  Downloading pyzmq-24.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (894 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 894.4/894.4 kB 9.7 MB/s eta 0:00:00
Collecting numpy<2.0,>=1.24
  Downloading numpy-1.24.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.0/14.0 MB 12.1 MB/s eta 0:00:00
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
  ╰─> [59 lines of output]
      Compiling pyModeS/c_common.pyx because it depends on /tmp/pip-build-env-7w16oqq3/overlay/lib/python3.8/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pyModeS/decoder/flarm/decode.pyx because it depends on /tmp/pip-build-env-7w16oqq3/overlay/lib/python3.8/site-packages/Cython/Includes/libc/string.pxd.
      [1/2] Cythonizing pyModeS/c_common.pyx
      [2/2] Cythonizing pyModeS/decoder/flarm/decode.pyx
      aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msse’
      aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msse2’
      aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mfma’
      aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mfpmath=sse’
      Traceback (most recent call last):
        File "/usr/lib/python3.8/distutils/unixccompiler.py", line 117, in _compile
          self.spawn(compiler_so + cc_args + [src, '-o', obj] +
        File "/usr/lib/python3.8/distutils/ccompiler.py", line 910, in spawn
          spawn(cmd, dry_run=self.dry_run)
        File "/usr/lib/python3.8/distutils/spawn.py", line 36, in spawn
          _spawn_posix(cmd, search_path, dry_run=dry_run)
        File "/usr/lib/python3.8/distutils/spawn.py", line 157, in _spawn_posix
          raise DistutilsExecError(
      distutils.errors.DistutilsExecError: command 'aarch64-linux-gnu-gcc' failed with exit status 1

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "build.py", line 77, in <module>
          build()
        File "build.py", line 65, in build
          cmd.run()
        File "/usr/lib/python3.8/distutils/command/build_ext.py", line 340, in run
          self.build_extensions()
        File "/usr/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
          self._build_extensions_serial()
        File "/usr/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
          self.build_extension(ext)
        File "/usr/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
          objects = self.compiler.compile(sources,
        File "/usr/lib/python3.8/distutils/ccompiler.py", line 574, in compile
          self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
        File "/usr/lib/python3.8/distutils/unixccompiler.py", line 120, in _compile
          raise CompileError(msg)
      distutils.errors.CompileError: command 'aarch64-linux-gnu-gcc' failed with exit status 1
      Traceback (most recent call last):
        File "/home/pi/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/home/pi/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/pi/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 249, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-7w16oqq3/overlay/lib/python3.8/site-packages/poetry/core/masonry/api.py", line 56, in build_wheel
          return WheelBuilder.make_in(
        File "/tmp/pip-build-env-7w16oqq3/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 85, in make_in
          wb.build(target_dir=directory)
        File "/tmp/pip-build-env-7w16oqq3/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 120, in build
          self._build(zip_file)
        File "/tmp/pip-build-env-7w16oqq3/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 169, in _build
          self._run_build_script(self._package.build_script)
        File "/tmp/pip-build-env-7w16oqq3/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 229, in _run_build_script
          subprocess.check_call([self.executable.as_posix(), build_script])
        File "/usr/lib/python3.8/subprocess.py", line 364, 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

Looks like it is related to #137 then

xoolive commented 1 year ago

Ok i think it is. Can you try the fix from the other issue? Otherwise I guess we should just remove all optimisation flags and make a new release

jonrau1 commented 1 year ago

@xoolive that ended up working, got to love arm64 and how it messes everything up

xoolive commented 1 year ago

@jonrau1 what did you have to change?