AppDaemon / appdaemon

:page_facing_up: Python Apps for Home Automation
Other
833 stars 418 forks source link

Python 3.12 support #1906

Open canassa opened 8 months ago

canassa commented 8 months ago

Is there an existing feature request for this?

Your feature request

Hello,

I tried installing AppDaemon with Python 3.12 and I got this error:

      aiohttp/_websocket.c: In function ‘__Pyx_PyInt_As_long’:
      aiohttp/_websocket.c:3042:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
       3042 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
            |                                                     ^~
      aiohttp/_websocket.c:3097:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
       3097 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
            |                                                     ^~
      aiohttp/_websocket.c: In function ‘__Pyx_PyInt_As_int’:
      aiohttp/_websocket.c:3238:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
       3238 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
            |                                                     ^~
      aiohttp/_websocket.c:3293:53: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
       3293 |             const digit* digits = ((PyLongObject*)x)->ob_digit;
            |                                                     ^~
      aiohttp/_websocket.c: In function ‘__Pyx_PyIndex_AsSsize_t’:
      aiohttp/_websocket.c:3744:45: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
       3744 |     const digit* digits = ((PyLongObject*)b)->ob_digit;
            |                                             ^~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

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

This seems to be related to this aiohttp issue. Looks like it can be workaround by installing aiohttp==3.9.0b0

acockburn commented 7 months ago

We will have a look at 3.12 support soon - the package dependencies haven't been updated in a few months, which isn't helping. When we get that done we'll take a look at 3.12

acockburn commented 7 months ago

So it looks like the 3.9 versions of aiohttp didn't resolve this, or we ran into another problem. Checking into it now. My goal is to have Python 3.12 support in the next release.

brent20 commented 5 months ago

Just ran into this the hard way after upgrading to Python 3.12 for Home Assistant's requirement. Any update on this? Thanks!

sqozz commented 5 months ago

@brent20 the current git-version works with python3.12 and can be installed with: pip install git+https://github.com/AppDaemon/appdaemon.git

DaveDixon commented 2 weeks ago

pip3 install appdaemon still fails under Ubuntu 24.04 with python12. The current git-version (thanks @sqozz) does install okay.

acockburn commented 2 weeks ago

I did some work in the last few days to update dependencies and get 3.12 working so this should be resolved in the next release.