pythonprofilers / memory_profiler

Monitor Memory usage of Python code
http://pypi.python.org/pypi/memory_profiler
Other
4.39k stars 380 forks source link

Import fails in Python3.11 with `ImportError: cannot import name 'coroutine' from 'asyncio'` #364

Closed daanzu closed 1 year ago

daanzu commented 2 years ago

Was deprecated and is being removed in 3.11: https://docs.python.org/3/library/asyncio-task.html#asyncio.coroutine

  Traceback (most recent call last):
    File "/project/test_webrtcvad.py", line 5, in <module>
      from memory_profiler import memory_usage
    File "/tmp/tmp.EWDmnIKBET/venv/lib/python3.11/site-packages/memory_profiler.py", line 10, in <module>
      from asyncio import coroutine, iscoroutinefunction
  ImportError: cannot import name 'coroutine' from 'asyncio' (/opt/python/cp311-cp311/lib/python3.11/asyncio/__init__.py)
fabianp commented 2 years ago

thanks for the report. Would you be willing to submit a pull request fixing this issue?

jakirkham commented 2 years ago

Sounds like this was fixed ( https://github.com/pythonprofilers/memory_profiler/issues/375#issuecomment-1315697011 )

daanzu commented 1 year ago

Since I can't easily test myself, I'll assume this is fixed, and close.