0

I had a python program that ran fine about 2 months ago (February 2023). However, I reran the program today (April 2023), and now I'm running into issues. My python environment has not changed.

openai.Completion.create(
  model="text-davinci-003",
  prompt="Say this is a test",
  max_tokens=7,
  temperature=0
)

The program returns an AttributeError that states module 'openai' has no attribute 'api_type'. It appears OpenAI must have depreciated my library, and I no longer can run the code in its current form. How can I correct this error?

Under guidance of other posts, I simply updated my package using the following command:

pip install --upgrade openai

Unfortunately, the update fails and issues the following issue:

  WARNING: Failed to write executable - trying to use .deleteme logic
ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified: 'C:\\Python311\\Scripts\\normalizer.exe' -> 'C:\\Python311\\Scripts\\normalizer.exe.deleteme'

Without the update, the openai code in my program cannot properly run.

Ynjxsjmh
  • 28,441
  • 6
  • 34
  • 52
ashap551
  • 23
  • 1
  • 6
  • Give this command a shot `python -m pip install -U pip --user`, then try upgrade or reinstall opeani module. https://stackoverflow.com/questions/66691204/how-to-solve-oserror-winerror-2-impossibile-finding-specified-file-c-pyth – Anony Mous Apr 15 '23 at 00:32
  • Sorry, just to add, try installing the package as administrator (Win+R, cmd, shift+enter, Yes, `python -m pip install --upgrade openai`) – Anony Mous Apr 15 '23 at 00:50

0 Answers0