'PanicException: env_logger::init_from_env should not be called after logger initialized: SetLoggerError(())

When I try to run a line of code:

from transformers import pipeline

I am getting the panicException as follow as:

PanicException: env_logger::init_from_env should not be called after logger initialized: SetLoggerError(()) in Python



Solution 1:[1]

Looks like this is a Rust module that's packaged with python. It uses env_logger, which needs to be set before the logger is created in Python. That's why this happened. It looks like a a bug in the library itself.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 stonecharioteer