L1 Error: module 'openai' has no attribute 'ChatCompletion'

I am getting this error: AttributeError: module ‘openai’ has no attribute ‘ChatCompletion’

This error appears after cell 4 get_completion(“What is 1+1?”) when I run it in my own notebook. I installed all of the packages including the latest openai package and my Open AI key seems to be working since cells 1-3 are running fine.

How can I fix this error?

If you’re install pip openai previously, please uninstall it. Then install !pip install openai==0.27.8, and everything will work fine.

1 Like

Thanks! I fixed it on my notebook