Cannot import name "get" from voltage.utils
HGStyle opened this issue · comments
HGStyle commented
Summary
If you run your revolt bot, an error will occurs.
Reproduction Steps
I only coded a Revolt bot.
Minimal Reproducible Code
import voltage, os
rvl_cli = voltage.Client()
rvl_token = os.getenv('revolt')
@rvl_cli.listen('ready')
async def on_rdy():
print('Revolt bot is ready !')
rvl_cli.run(rvl_token)
Expected Results
Run the bot
Actual Results
It crashed.
Traceback (most recent call last):
File "main.py", line 2, in <module>
import voltage
File "/home/runner/Discord2Revolt/venv/lib/python3.8/site-packages/voltage/__init__.py", line 32, in <module>
from .client import Client
File "/home/runner/Discord2Revolt/venv/lib/python3.8/site-packages/voltage/client.py", line 10, in <module>
from .internals import CacheHandler, HTTPHandler, WebSocketHandler
File "/home/runner/Discord2Revolt/venv/lib/python3.8/site-packages/voltage/internals/__init__.py", line 7, in <module>
from .cache import CacheHandler
File "/home/runner/Discord2Revolt/venv/lib/python3.8/site-packages/voltage/internals/cache.py", line 11, in <module>
from ..server import Server
File "/home/runner/Discord2Revolt/venv/lib/python3.8/site-packages/voltage/server.py", line 9, in <module>
from .invites import Invite
File "/home/runner/Discord2Revolt/venv/lib/python3.8/site-packages/voltage/invites.py", line 7, in <module>
from .utils import get
ImportError: cannot import name 'get' from 'voltage.utils' (/home/runner/Discord2Revolt/venv/lib/python3.8/site-packages/voltage/utils/__init__.py)
Checklist
- I have searched the open issues for duplicates.
- I have shown the entire traceback, if possible.
- I have removed my token from display, if visible.
Additional Context
I have found a fix :
- Copy all the content of the
voltage/utils.py
file - Go to the file
voltage/utils/__init__.py
. - Paste all the code in the file
- Move the line
from __future__ import annotations
at the first line - Fixed ! (i think)
HGStyle commented
I'm just waiting for anyone to fix it in the repo (because idk how to suggest a fix :/ )
Enoki commented
pip uninstall voltage && pip install git+https://github.com/enokiun/voltage
is the current solution for this, why this occurs escapes me and I'm left to assume that it's merely PyPI's fault, if you have any ideas why the PyPI version of voltage is always borked like this besides the old utils
submodule being cached then please do LMK