Having trouble while installing and using openai with pip

Hello guys. I’m trying to use the openai in python, but every time when I run the openai tools fine_tunes.prepare_data -f <LOCAL_FILE> command on my terminal, it doesn’t run the script but opens a file on my browser:

Can you guys please help me?

1 Like

Yes, I actually took a day to figure out what was going on. When you call ‘openai’ in the terminal on Windows, it actually is a file that is contained within one of the directories listed in the Windows PATH Environmental Variable, and because it does not have an extension, Windows will ask you how to open it.

This file is meant to be used within Linux since a BASH shell is the shell needed to run this file but Windows PowerShell and Command Prompt aren’t BASH compatible by default.

You can download Git Bash for Windows, or WSL 2.0 and those will correctly interpret the file!

Source: Weird Error while finetuning - #6 by DutytoDevelop


All right. So I’ll try it using Git Bash. Thank you so much for the support

1 Like

Can we please get this updated on the API reference?

1 Like

That would be good, I’ll send a message to the OpenAI support team later today regarding this

Just a quick update everyone, I think I may have discovered a way to completely fix this for Windows users so I’ve notified OpenAI staff of my findings. Here’s a screenshot of it working in Command Prompt & PowerShell:

Command Prompt:


In case the solution I provided is not viable though, I have also sent a request to update the API documentation as @overbeck.christopher requested on behalf of all Windows users affected by this issue.

I’ll keep y’all updated!

1 Like

Mate! → I solved all my $env: woes with Anaconda. Great tool thus far and it solved my Python and Pytorch troubles ← I was setting up to use Dall-E

(see that’s the thing with GPT3! it’s like candy for a nerd!!! one moment you’re reading Dall-E, next Codex, next you’re chatting… .LoL! AIADD :stuck_out_tongue: )

1 Like

Gotcha! I’m simply trying to implement a holistic solution for all Windows users to be able to install the OpenAI Python module and use the CLI data preparation tool straight out of the box without needing additional dependencies or programs to get it to work. I literally dove into setuptools module to learn how to package modules last night, and so far, I’ve made a ton of progress to create a working solution that will allow the CLI tool to be usable right from module installation!

1 Like

Right on Mate! :slight_smile: I’m a huge proponent of easier packages for users.
That being said, your user base that needs Python, is probably fine with conda. Given that it allows you to manage environment variables depending on what you are working at the time, I think your audience might like it.

1 Like