python中的轻量级图表导入错误

k2fxgqgv  于 2023-05-23  发布在  Python
关注(0)|答案(2)|浏览(219)

我已经成功安装了lwc
pip install lightweight_charts
我在这一行下面得到这个错误,请告知:
from lightweight_charts import Chart

Traceback (most recent call last):
  File "c:\Users\naveen\Downloads\Telegram Desktop\strat-0.29.py", line 14, in <module>
    from lightweight_charts import Chart
  File "C:\Users\naveen\AppData\Roaming\Python\Python39\site-packages\lightweight_charts\__init__.py", line 1, in <module>
    from .chart import Chart
  File "C:\Users\naveen\AppData\Roaming\Python\Python39\site-packages\lightweight_charts\chart.py", line 
8, in <module>
    from lightweight_charts.pywebview import _loop
  File "C:\Users\naveen\AppData\Roaming\Python\Python39\site-packages\lightweight_charts\pywebview.py", line 6, in <module>
    from lightweight_charts.js import LWC
  File "C:\Users\naveen\AppData\Roaming\Python\Python39\site-packages\lightweight_charts\js.py", line 47, in <module>
    class LWC:
  File "C:\Users\naveen\AppData\Roaming\Python\Python39\site-packages\lightweight_charts\js.py", line 528, in LWC
    width: float = 0.5, height: float = 0.5, sync: bool | UUID = False):
TypeError: unsupported operand type(s) for |: 'type' and 'type'
pbpqsu0x

pbpqsu0x1#

尝试将python升级到v3.10

gfttwv5a

gfttwv5a2#

您可能需要升级Python。
对于python 3.10来说效果很好。
git官方页面说3.9+

错误的相关链接:https://github.com/tiangolo/typer/issues/371
git链接:https://github.com/louisnw01/lightweight-charts-python

相关问题