OpenAi command not found Ubuntu 20.04

Hello everyone,
i know this question has been asked before, but none of the threads helped me.

I am currently trying to finetune a GPT-3 model for an academic project.
To do this I installed the Linux subsystem on my Windows and installed Ubuntu 20.04…
I followed the instructions here: (OpenAI API) and everything worked.
But when trying to run the command: openai tools fine_tunes.prepare_data -f<LOCAL_FILE> I allways get the same error, which is: openai: command not found.

I am not surprised by this because i dont think you can set path variables by installing some python package over pip.
I tried looking the package up, but found no “tools” inside there, where i could have set the path variable to.
Generally i am quite confused.

Does anyone have a solution to this issue?

1 Like

Hi @lechnerf ,

Your WSL is not able to find a path to map the “openai” command to. You don’t need to map it to tools.

Use these instructions on your WSL Linux to set “openai” env variable permanently from a bash terminal

  • Launch your wsl instance.
  • $ sudo vim ~/.bashrc
  • Enter your password.
  • Press i to go into edit mode. Go to the end of the file using arrow key.
  • Add your variable as openai=<PATH TO OPENAI> at the end of the file.
  • Press esc key to get out of edit mode.
  • Enter :wq and press enter . This will save and close the file.
  • $ source ~/.bashrc will load your recent changes into your current shell.

Follow @m-a.schenk 's post to get the path for ‘openai’.


Thank you, this actually worked, i can’t believe it


Hi sps, when you say:
what do you mean? how can I get that?


Welcome to the community.

It means the location where the openai-cli utility is installed.