Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'openai' has no attribute 'error' #1564

Open
sahilrajput03 opened this issue Oct 17, 2024 · 1 comment
Open

AttributeError: module 'openai' has no attribute 'error' #1564

sahilrajput03 opened this issue Oct 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sahilrajput03
Copy link

Describe the bug

pip --version
pip 24.2 from /Users/apple/Documents/github_repos/test1/venv/lib/python3.13/site-packages/pip (python 3.13)

I am getting this error:

(venv) apple@apples-MacBook-Pro test1 % oaieval --help
Traceback (most recent call last):
  File "/Users/apple/Documents/github_repos/test1/venv/bin/oaieval", line 5, in <module>
    from evals.cli.oaieval import main
  File "/Users/apple/Documents/github_repos/test1/venv/lib/python3.13/site-packages/evals/__init__.py", line 2, in <module>
    from .completion_fns.openai import (
    ...<3 lines>...
    )
  File "/Users/apple/Documents/github_repos/test1/venv/lib/python3.13/site-packages/evals/completion_fns/openai.py", line 13, in <module>
    from evals.utils.api_utils import (
    ...<2 lines>...
    )
  File "/Users/apple/Documents/github_repos/test1/venv/lib/python3.13/site-packages/evals/utils/api_utils.py", line 12, in <module>
    openai.error.ServiceUnavailableError,
    ^^^^^^^^^^^^
AttributeError: module 'openai' has no attribute 'error'

To Reproduce

mkdir test1; cd test1
python -m venv venv
pip install evals
oaieval --help

Code snippets

No response

OS

sequioa 15.0.1 (24A348)

Python version

Python 3.13.0

Library version

latest

@sahilrajput03 sahilrajput03 added the bug Something isn't working label Oct 17, 2024
@sahilrajput03
Copy link
Author

sahilrajput03 commented Oct 17, 2024

I tried this on archlinux and facing exactly same issue using same procedure defined above.


Also, I'm unable to use evals module inside any script. Here is MRE:

File: one.py

import evals

On running this script via python one.py I get following error as shown below:

(venv) apple@apples-MacBook-Pro test1 % python one.py 
Traceback (most recent call last):
  File "/Users/apple/Documents/github_repos/test1/one.py", line 1, in <module>
    import evals
  File "/Users/apple/Documents/github_repos/test1/venv/lib/python3.13/site-packages/evals/__init__.py", line 2, in <module>
    from .completion_fns.openai import (
    ...<3 lines>...
    )
  File "/Users/apple/Documents/github_repos/test1/venv/lib/python3.13/site-packages/evals/completion_fns/openai.py", line 13, in <module>
    from evals.utils.api_utils import (
    ...<2 lines>...
    )
  File "/Users/apple/Documents/github_repos/test1/venv/lib/python3.13/site-packages/evals/utils/api_utils.py", line 12, in <module>
    openai.error.ServiceUnavailableError,
    ^^^^^^^^^^^^
AttributeError: module 'openai' has no attribute 'error'

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant