aleph-im / aleph-sdk-python

Python SDK library for the Aleph.im network
MIT License
2 stars 4 forks source link

Cannot install on Python 3.11 #46

Closed hoh closed 4 months ago

hoh commented 1 year ago

We get the following error:

ERROR: Cannot install aleph-sdk-python and aleph-sdk-python==0.7.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    aleph-sdk-python 0.7.0 depends on coincurve>=17.0.0; python_version >= "3.11"
    eciespy 0.3.13 depends on coincurve<18 and >=13
hoh commented 1 year ago

PyPI provides binaries for eciespy 17 until Python 3.10. I get a build error on Debian 12.

hoh commented 1 year ago

When attempting to build on Debian 12:

Building wheels for collected packages: coincurve
  Building wheel for coincurve (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for coincurve (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [72 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/coincurve
      copying coincurve/context.py -> build/lib.linux-x86_64-cpython-311/coincurve
      copying coincurve/types.py -> build/lib.linux-x86_64-cpython-311/coincurve
      copying coincurve/utils.py -> build/lib.linux-x86_64-cpython-311/coincurve
      copying coincurve/flags.py -> build/lib.linux-x86_64-cpython-311/coincurve
      copying coincurve/_windows_libsecp256k1.py -> build/lib.linux-x86_64-cpython-311/coincurve
      copying coincurve/__init__.py -> build/lib.linux-x86_64-cpython-311/coincurve
      copying coincurve/ecdsa.py -> build/lib.linux-x86_64-cpython-311/coincurve
      copying coincurve/keys.py -> build/lib.linux-x86_64-cpython-311/coincurve
      copying coincurve/py.typed -> build/lib.linux-x86_64-cpython-311/coincurve
      running build_clib
      /tmp/pip-install-m1d1svyd/coincurve_4ee2e3c932b646b29048bd1293b1718e/libsecp256k1/autogen.sh: 3: autoreconf: not found
      Traceback (most recent call last):
        File "/opt/aleph-venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/aleph-venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/aleph-venv/lib/python3.11/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-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 264, in <module>
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 97, in run
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_99vtyto/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 154, in run
        File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/tmp/pip-install-m1d1svyd/coincurve_4ee2e3c932b646b29048bd1293b1718e/libsecp256k1/autogen.sh']' returned non-zero exit status 127.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for coincurve
Failed to build coincurve
ERROR: Could not build wheels for coincurve, which is required to install pyproject.toml-based projects
odesenfans commented 1 year ago

From a Docker image, I had to run apt install autoconf libtool make pkg-config python3-dev to get the package to build. It's a lot of dependencies though.

hoh commented 1 year ago

pkg-config is in transition, pkgconf should be used instead.

MHHukiewitz commented 8 months ago

Interesting enough, 3.11 works just fine on macOS, but not 3.12: https://github.com/aleph-im/aleph-sdk-python/pull/74

hoh commented 4 months ago

I use the SDK on Python 3.11 all the time, I guess this is solved.