spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.22k stars 3.02k forks source link

AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'? #8992

Closed GEEKGEEKOP closed 2 months ago

GEEKGEEKOP commented 3 months ago
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?

WTF?

SomberNight commented 2 months ago

Would you be kind enough to provide the full traceback and ideally give some context? @asyncio.coroutine does not appear in our code.

GEEKGEEKOP commented 2 months ago

Would you be kind enough to provide the full traceback and ideally give some context? @asyncio.coroutine does not appear in our code.

[noroozi@dhcppc7 ~]$ electrum 
Traceback (most recent call last):
  File "/home/noroozi/.local/bin/electrum", line 89, in <module>
    check_imports()
  File "/home/noroozi/.local/bin/electrum", line 74, in check_imports
    import aiorpcx
  File "/home/noroozi/.local/lib/python3.11/site-packages/aiorpcx/__init__.py", line 8, in <module>
    from .websocket import *
  File "/home/noroozi/.local/lib/python3.11/site-packages/aiorpcx/websocket.py", line 30, in <module>
    import websockets
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/__init__.py", line 3, in <module>
    from .client import *
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/client.py", line 13, in <module>
    from .extensions.permessage_deflate import ClientPerMessageDeflateFactory
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/extensions/permessage_deflate.py", line 13, in <module>
    from ..framing import CTRL_OPCODES, OP_CONT
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/framing.py", line 56, in <module>
    class Frame(FrameData):
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/framing.py", line 76, in Frame
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?
[noroozi@dhcppc7 ~]$ 
SomberNight commented 2 months ago

aiorpcx has websockets as an optional dependency Looks like you have websockets installed, but it is a very old version. At the same time, you are using a fairly recent version of python. This old vs new mismatch is causing the problem.

You will need to either upgrade or delete the websockets package.

GEEKGEEKOP commented 2 months ago
[noroozi@fedora ~]$ pip install websockets
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: websockets in ./.local/lib/python3.11/site-packages (6.0)

[notice] A new release of pip is available: 23.3.2 -> 24.0
[notice] To update, run: python3 -m pip install --upgrade pip
**********************************************************************
[noroozi@fedora ~]$ electrum 
Traceback (most recent call last):
  File "/home/noroozi/.local/bin/electrum", line 89, in <module>
    check_imports()
  File "/home/noroozi/.local/bin/electrum", line 74, in check_imports
    import aiorpcx
  File "/home/noroozi/.local/lib/python3.11/site-packages/aiorpcx/__init__.py", line 8, in <module>
    from .websocket import *
  File "/home/noroozi/.local/lib/python3.11/site-packages/aiorpcx/websocket.py", line 30, in <module>
    import websockets
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/__init__.py", line 3, in <module>
    from .client import *
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/client.py", line 13, in <module>
    from .extensions.permessage_deflate import ClientPerMessageDeflateFactory
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/extensions/permessage_deflate.py", line 13, in <module>
    from ..framing import CTRL_OPCODES, OP_CONT
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/framing.py", line 56, in <module>
    class Frame(FrameData):
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/framing.py", line 76, in Frame
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?
[noroozi@fedora ~]$ 

this is?

GEEKGEEKOP commented 2 months ago
[noroozi@fedora ~]$ python
Python 3.11.8 (main, Feb 28 2024, 00:00:00) [GCC 13.2.1 20231011 (Red Hat 13.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import websockets
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/__init__.py", line 3, in <module>
    from .client import *
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/client.py", line 13, in <module>
    from .extensions.permessage_deflate import ClientPerMessageDeflateFactory
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/extensions/permessage_deflate.py", line 13, in <module>
    from ..framing import CTRL_OPCODES, OP_CONT
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/framing.py", line 56, in <module>
    class Frame(FrameData):
  File "/home/noroozi/.local/lib/python3.11/site-packages/websockets/framing.py", line 76, in Frame
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?
>>> 
accumulator commented 2 months ago

As mentioned above, nothing we can do. closing.

SomberNight commented 2 months ago
[noroozi@fedora ~]$ pip install websockets
Requirement already satisfied: websockets in ./.local/lib/python3.11/site-packages (6.0)

The flag you want is --upgrade: $ pip install --upgrade websockets