pythonprofilers / memory_profiler

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

do not work in python 3.11 #375

Closed grom311 closed 2 years ago

grom311 commented 2 years ago

I updated python from 3.10.4 to 3.11 and have error:

Traceback (most recent call last):
  File "main.py", line 16, in <module>
    from memory_profiler import memory_usage
  File ".venv_3.11\Lib\site-packages\memory_profiler.py", line 10, in <module>
    from asyncio import coroutine, iscoroutinefunction
ImportError: cannot import name 'coroutine' from 'asyncio' (\Python311\Lib\asyncio\__init__.py)
altendky commented 2 years ago

Sorry for the hassle. This has been fixed in https://github.com/pythonprofilers/memory_profiler/pull/368 and CI here now tests against 3.11 from https://github.com/pythonprofilers/memory_profiler/pull/370. But... a release hasn't been made. I'll try to get to that in the next couple days.

I'm happy to help with workarounds in the mean time. One option would be to use a dependency like 'memory_profiler @ git+https://github.com/pythonprofilers/memory_profiler@master' when installing.

altendky commented 2 years ago

v0.61.0 is available at https://pypi.org/project/memory-profiler/0.61.0/ with CPython 3.11 support. Give it a try and let me know if it is working for you. If so, feel free to close this issue. Otherwise, I'd be interested to see any problems.

grom311 commented 2 years ago

v0.61.0 is work correctly. Thank your! Task can be closed.