mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1.17k stars 177 forks source link

SyntaxError codecarbon/core/api_client.py line 117 #716

Open 3rickfs opened 6 days ago

3rickfs commented 6 days ago

Description

after installing the last version of codecarbon my script is running into issues due to a syntax error in api_client.py file, line 117: if organization := self.check_organization_exists(organization_name):

To be able to run my script I just replaced ":" by "=". I am unsure why it worked in previous runs, now it is complaining about it. But, yeah, the syntax is wrong.

benoit-cty commented 5 days ago

Hi, thanks for reporting your issue!

The walrus operator := exist since Python 3.8. Are you using Python 3.7 ?

Please note that 3.7 and 3.8 are deprecated : https://devguide.python.org/versions/

By the way, we are finalizing the new API usage, and so you may have problems using it. The new web interface is not in production.

The standalone package with output CSV is supposed to works fine. But maybe no more in Python 3.7 if I understand your problem.