BerriAI / reliableGPT

Get 100% uptime, reliability from OpenAI. Handle Rate Limit, Timeout, API, Keys Errors
MIT License
630 stars 37 forks source link

Import error #26

Closed c0d3rman closed 1 year ago

c0d3rman commented 1 year ago

Hi there, maybe I messed up something during installation, but I can't seem to import the package.

I have reliablegpt-0.2.9612 installed in python 3.11.4 on Mac. When running from reliablegpt import reliableGPT I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'reliableGPT' from 'reliablegpt' (/opt/homebrew/lib/python3.11/site-packages/reliablegpt/__init__.py)

When trying to import the package as a whole I get nothing attached to it:

>>> import reliablegpt
>>> dir(reliablegpt)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']

Am I doing something wrong?

krrishdholakia commented 1 year ago

hey @c0d3rman that's odd - just pushed a couple updates, can you try now. I believe our local Macs have similar specs.

Is this an M-series Mac or Intel?

c0d3rman commented 1 year ago

Reinstalled, still the same issue. It's an M-series mac. Note that I'm installing from pip, not from source. Here's what my reliablegpt/__init__.py file looks like:

# reliablegpt/__init__.py
# from .RateLimitHandler_helpers import *
# from .Alerting import *
# from .IndividualRequest import *
# from .Model import *
# from .RateLimitHandler import *
# from .main import *  # Import all the symbols from main.py

That's probably the cause of the issue. Not sure why it's like this though.

ishaan-jaff commented 1 year ago

what version of reliableGPT are you using ?

can you try pip install reliableGPT==0.2.976

My phone number is +1 4126186238 if it does not work again and you'd like to resolve it faster. Else will monitor here

c0d3rman commented 1 year ago

Hi, I reinstalled everything in a fresh virtual env and then manually installed some dependencies (waitress and flask), and have finally gotten it to work. The version I had before was 0.2.9612, which is the one I got from a vanilla pip install reliablegpt. After today's reinstall, I now have 0.2.976. For some reason, pip wouldn't update to 0.2.976 even with pip install -U reliablegpt, but a force reinstall did it. (The install still errors until I manually install those dependencies though.)

ishaan-jaff commented 1 year ago

does it work for you now @c0d3rman ?

c0d3rman commented 1 year ago

Yes it does

ishaan-jaff commented 1 year ago

FYI you can view your requests / saved exceptions at: https://reliable-gpt-fe.vercel.app/<user email> It looks like this

Screenshot 2023-07-07 at 9 08 03 AM

live link: https://reliable-gpt-fe.vercel.app/