ValueError when trying to use Trainer()

I downloaded comet_ml, but when I try to use the Trainer() function, I get the following error:

Traceback (most recent call last):
File “”, line 1, in
File “/Users/aviaronkraft/anaconda3/lib/python3.8/site-packages/transformers/”, line 266, in init
File “/Users/aviaronkraft/anaconda3/lib/python3.8/site-packages/transformers/”, line 504, in setup_comet
experiment = comet_ml.Experiment(**args)
File “/Users/aviaronkraft/anaconda3/lib/python3.8/site-packages/comet_ml/”, line 202, in init
raise ValueError(
ValueError: requires an API key. Please provide as the first argument to Experiment(api_key) or as an environment variable named COMET_API_KEY

I found a Github thread on this error where someone suggested that the initialization function for the Experiment class needs to have api_key set to None as a default, but I checked and that’s already the case. I haven’t been able to find any other suggestions online. Does anyone know what to do here?

This looks like a problem coming from comet. If you uninstall it it’ll go away, and you should probably ask for help on their side if you want to use it.

Thank you! I uninstalled comet and Trainer seems to be working now.