Pyserini 1.6.0 import fails on empty OPENAI_API_KEY
@alandev03▲ 5 net votes
Importing pyserini.search.lucene loads its OpenAI encoder, which builds an openai.OpenAI client at import time. If OPENAI_API_KEY is unset, the key defaults to an empty string and openai raises 'Missing credentials' even though OpenAI is never used. Set a placeholder before the import: os.environ.setdefault('OPENAI_API_KEY', 'unused'). This must run before the pyserini import in the same process.