I am not involved in that course, but I infer that expression in Python assumes the local presence of the openai library. For example, you would need to download and install into your local environment…
It can become non-trivial to establish and maintain a local environment that mimics the course cloud compute environment. This thread has additional details…