I have installed successfully lwc
pip install lightweight_charts
I get this error below at this line, please advise:
from lightweight_charts import Chart
Traceback (most recent call last):
File "c:UsersnaveenDownloadsTelegram Desktopstrat-0.29.py", line 14, in <module>
from lightweight_charts import Chart
File "C:UsersnaveenAppDataRoamingPythonPython39site-packageslightweight_charts__init__.py", line 1, in <module>
from .chart import Chart
File "C:UsersnaveenAppDataRoamingPythonPython39site-packageslightweight_chartschart.py", line
8, in <module>
from lightweight_charts.pywebview import _loop
File "C:UsersnaveenAppDataRoamingPythonPython39site-packageslightweight_chartspywebview.py", line 6, in <module>
from lightweight_charts.js import LWC
File "C:UsersnaveenAppDataRoamingPythonPython39site-packageslightweight_chartsjs.py", line 47, in <module>
class LWC:
File "C:UsersnaveenAppDataRoamingPythonPython39site-packageslightweight_chartsjs.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'
2
Answers
Try to upgrade python to v 3.10
You may need to upgrade your python.
It works well for
python 3.10
.Official git page says
3.9+
:Related link to error: https://github.com/tiangolo/typer/issues/371
Link to git: https://github.com/louisnw01/lightweight-charts-python