TA-Lib / ta-lib-python

Python wrapper for TA-Lib (http://ta-lib.org/).
http://ta-lib.github.io/ta-lib-python
Other
9.79k stars 1.78k forks source link

Cannot import name 'GenericAlias' - probably import cycle #617

Closed SavostinVladimir closed 2 weeks ago

SavostinVladimir commented 1 year ago

Hi! I've installed freqtrade as PyCharm project to have possibility for runtime debug... I've install all dependencies. Python version - 3.9

Now I try to run freqtrade/main.py just to check that it works, but have this output

/home/vova/PycharmProjects/freqtrade/venv/bin/python /home/vova/PycharmProjects/freqtrade/freqtrade/main.py 
Traceback (most recent call last):
  File "/home/vova/PycharmProjects/freqtrade/freqtrade/main.py", line 6, in <module>
    import logging
  File "/usr/lib/python3.9/logging/__init__.py", line 26, in <module>
    import sys, os, time, io, re, traceback, warnings, weakref, collections.abc
  File "/usr/lib/python3.9/re.py", line 124, in <module>
    import enum
  File "/usr/lib/python3.9/enum.py", line 2, in <module>
    from types import MappingProxyType, DynamicClassAttribute
  File "/home/vova/PycharmProjects/freqtrade/freqtrade/types/__init__.py", line 2, in <module>
    from freqtrade.types.backtest_result_type import (BacktestHistoryEntryType, BacktestMetadataType,
  File "/home/vova/PycharmProjects/freqtrade/freqtrade/types/__init__.py", line 2, in <module>
    from freqtrade.types.backtest_result_type import (BacktestHistoryEntryType, BacktestMetadataType,
  File "/home/vova/PycharmProjects/freqtrade/freqtrade/types/backtest_result_type.py", line 1, in <module>
    from typing import Any, Dict, List
  File "/usr/lib/python3.9/typing.py", line 23, in <module>
    import contextlib
  File "/usr/lib/python3.9/contextlib.py", line 6, in <module>
    from functools import wraps
  File "/usr/lib/python3.9/functools.py", line 22, in <module>
    from types import GenericAlias
ImportError: cannot import name 'GenericAlias' from partially initialized module 'types' (most likely due to a circular import) (/home/vova/PycharmProjects/freqtrade/freqtrade/types/__init__.py)

Process finished with exit code 1
mrjbq7 commented 1 year ago

This is the wrong project to report that bug. Maybe here?https://github.com/freqtrade/freqtradeOn Sep 27, 2023, at 6:24 AM, SavostinVladimir @.***> wrote: Hi! I've installed freqtrade as PyCharm project to have possibility for runtime debug... I've install all dependencies. Python version - 3.9 Now I try to run freqtrade/main.py just to check that it works, but have this output /home/vova/PycharmProjects/freqtrade/venv/bin/python /home/vova/PycharmProjects/freqtrade/freqtrade/main.py Traceback (most recent call last): File "/home/vova/PycharmProjects/freqtrade/freqtrade/main.py", line 6, in import logging File "/usr/lib/python3.9/logging/init.py", line 26, in import sys, os, time, io, re, traceback, warnings, weakref, collections.abc File "/usr/lib/python3.9/re.py", line 124, in import enum File "/usr/lib/python3.9/enum.py", line 2, in from types import MappingProxyType, DynamicClassAttribute File "/home/vova/PycharmProjects/freqtrade/freqtrade/types/init.py", line 2, in from freqtrade.types.backtest_result_type import (BacktestHistoryEntryType, BacktestMetadataType, File "/home/vova/PycharmProjects/freqtrade/freqtrade/types/init.py", line 2, in from freqtrade.types.backtest_result_type import (BacktestHistoryEntryType, BacktestMetadataType, File "/home/vova/PycharmProjects/freqtrade/freqtrade/types/backtest_result_type.py", line 1, in from typing import Any, Dict, List File "/usr/lib/python3.9/typing.py", line 23, in import contextlib File "/usr/lib/python3.9/contextlib.py", line 6, in from functools import wraps File "/usr/lib/python3.9/functools.py", line 22, in from types import GenericAlias ImportError: cannot import name 'GenericAlias' from partially initialized module 'types' (most likely due to a circular import) (/home/vova/PycharmProjects/freqtrade/freqtrade/types/init.py)

Process finished with exit code 1

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

SavostinVladimir commented 1 year ago

Oh, yes! sorry. You are right)))