Using openai as a package for Python 3.10 (beta)

Hi, I have a student who is building an educational tool that creates text, code, and images for prompts using openai (like chatGPT) for his software project. It successfully works outside of Anvil.works, but wants to use this platform and has run into a module not found error. It doesnt matter how many times he installs/uninstalls or uses other options, he gets the same error of “ModuleNotFoundError: No module named ‘openai’”.

He has it installed on his computer through pip but cant seem to get it working through anvil. He has an education account.

Any help would be greatly appreciated.

2 Likes

Based on the error message, it looks like he is trying to use the openai module in client code. It is only available, however, in code run on the server. See: Client vs Server Code in Anvil

p.s. Welcome to the Anvil forum!

4 Likes

Thank you! I will pass this on.

1 Like