#AttributeError: type object 'Interaction' has no attribute 'respond'. Did you mean: 'response'?

1 messages · Page 1 of 1 (latest)

tacit bison
#

Could you please give the output of the pip list command

eternal steeple
# tacit bison Could you please give the output of the `pip list` command
Package            Version
------------------ ---------
aiohappyeyeballs   2.6.1
aiohttp            3.12.13
aiosignal          1.4.0
attrs              25.3.0
audioop-lts        0.2.1
certifi            2025.6.15
charset-normalizer 3.4.2
discord            2.3.2
discord.py         2.5.2
dotenv             0.9.9
frozenlist         1.7.0
idna               3.10
load-dotenv        0.1.0
multidict          6.6.3
mysql-connector    2.2.9
pip                25.1.1
propcache          0.3.2
py-cord            2.6.1
python-dotenv      1.1.1
requests           2.32.4
typing_extensions  4.14.1
unbelievaboat      2.2.0
urllib3            2.5.0
yarl               1.20.1
tacit bison
eternal steeple
#

Now im getting:
discord.errors.ExtensionFailed: Extension 'cogs.data_rs.logout_system' raised an error: RuntimeError: no running event loop

tacit bison
eternal steeple
#
Traceback (most recent call last):
  File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\discord\cog.py", line 796, in _load_from_module_spec
    setup(self)
    ~~~~~^^^^^^
  File "c:\Coding Projekte\discord\wpBot\cogs\data_rs\logout_system.py", line 187, in setup
    bot.add_cog(Logout(bot))
                ~~~~~~^^^^^
  File "c:\Coding Projekte\discord\wpBot\cogs\data_rs\logout_system.py", line 30, in __init__
    self.client = Client(os.getenv("API_TOKEN"))
                  ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\unbelievaboat\Client.py", line 43, in __init__
    self._session: aiohttp.ClientSession = aiohttp.ClientSession()
                                           ~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\aiohttp\client.py", line 316, in __init__
    loop = loop or asyncio.get_running_loop()
                   ~~~~~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: no running event loop

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 105, in <module>
    load_cogs()
    ~~~~~~~~~^^
  File "c:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 84, in load_cogs
    bot.load_extension(cog)
    ~~~~~~~~~~~~~~~~~~^^^^^
  File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\discord\cog.py", line 918, in load_extension
    self._load_from_module_spec(spec, name)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\discord\cog.py", line 801, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'cogs.data_rs.logout_system' raised an error: RuntimeError: no running event loop
tacit bison
eternal steeple
#

but now its not 😦

tacit bison
eternal steeple
tacit bison
#

Did you upgrade python recently ?

#

I see that you're using python 3.13

eternal steeple
#

i reset my pc

#

ig

#

maybe it was 3.12

tacit bison
#

Then you probably upgraded python. While there's only a couple of issues with 3.13 on pycords side, I would't be surprised that that unbelievaboat package you're using has some issues with 3.13

#

Please downgrade to python 3.12 or lower

eternal steeple
#

Traceback (most recent call last):
File "C:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 1, in <module>
import discord, random, time
ModuleNotFoundError: No module named 'discord'

tacit bison
#

install pycord

#

pip install py-cord

eternal steeple
#

i have

#

Package Version


aiohappyeyeballs 2.6.1
aiohttp 3.12.13
aiosignal 1.4.0
attrs 25.3.0
discord 2.3.2
discord.py 2.5.2
dotenv 0.9.9
frozenlist 1.7.0
idna 3.10
load-dotenv 0.1.0
multidict 6.6.3
mysql-connector 2.2.9
pip 25.1.1
propcache 0.3.2
py-cord 2.6.1
python-dotenv 1.1.1
typing_extensions 4.14.1
unbelievaboat 2.2.0
yarl 1.20.1

tacit bison
#

and also

#

.tag venv

ember stirrupBOT
#

Sometimes you want to keep libraries from polluting system installs or use a different version of libraries than the ones installed on the system. You might also not have permissions to install libraries system-wide. For this purpose, the standard library (as of Python 3.3) comes with a concept called "Virtual Environment"s to help maintain these separate versions.
The main benefit is to avoid package conflicts and unnecessary packages

Read more in the guide

eternal steeple
#

so i need todo what?

tacit bison
eternal steeple
#

done

tacit bison
#

Alright perfect. Now go in your bot's folder and run uv venv -p 3.12 --seed

eternal steeple
#

he doens't find the command

tacit bison
eternal steeple
#

Using CPython 3.12.10 interpreter at: C:\Users\rooky\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe
Creating virtual environment with seed packages at: .venv

  • pip==25.1.1
    Activate with: .venv\Scripts\activate
tacit bison
#

great

#

now, as it says, run .venv\Scripts\activate

eternal steeple
#

he cant find the command

tacit bison
#

huh

#

Oh mb activate should be capitalized

#

.venv\Scripts\Activate

#

just paste that in the terminal in your bot's directory

eternal steeple
# tacit bison just paste that in the terminal in your bot's directory

i do that but i get the following error:

.venv\Scripts\Activate : Die Datei "C:\Coding Projekte\discord\wpBot\.venv\Scripts\activate.ps1" kann nicht geladen werden, da die Ausführung von Skripts auf diesem System deaktiviert ist. Weitere Informationen finden  
Sie unter "about_Execution_Policies" (https:/go.microsoft.com/fwlink/?LinkID=135170).
In Zeile:1 Zeichen:1
+ .venv\Scripts\Activate
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : Sicherheitsfehler: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
tacit bison
#

Oh you need to enable the thingy

#

wait 1 sec imma find the command

#

run this Unblock-File .venv\Scripts\Activate.ps1

tacit bison
#

then the same command as before

tacit bison
eternal steeple
#
.venv\Scripts\Activate : Die Datei "C:\Coding Projekte\discord\wpBot\.venv\Scripts\activate.ps1" kann nicht geladen werden, da die Ausführung von Skripts auf diesem System deaktiviert ist. Weitere Informationen finden  
Sie unter "about_Execution_Policies" (https:/go.microsoft.com/fwlink/?LinkID=135170).
In Zeile:1 Zeichen:1
+ .venv\Scripts\Activate
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : Sicherheitsfehler: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

tacit bison
#

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process run this and then that command above again

eternal steeple
#

it worked

tacit bison
#

great

#

now you can use pip in there to install py-cord and whatever you'd need

eternal steeple
#

Its still showing me the same error:
Traceback (most recent call last):
File "C:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 1, in <module>
import discord, random, time
ModuleNotFoundError: No module named 'discord'

tacit bison
#

How are your running your bot ? Make sure you are running it from the same terminal you opened and you ran the other commands in.

eternal steeple
#

Now im getting this error again:

Traceback (most recent call last):
  File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\discord\cog.py", line 796, in _load_from_module_spec
    setup(self)
  File "C:\Coding Projekte\discord\wpBot\cogs\data_rs\logout_system.py", line 187, in setup
    bot.add_cog(Logout(bot))
                ^^^^^^^^^^^
  File "C:\Coding Projekte\discord\wpBot\cogs\data_rs\logout_system.py", line 30, in __init__
    self.client = Client(os.getenv("API_TOKEN"))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\unbelievaboat\Client.py", line 43, in __init__
    self._session: aiohttp.ClientSession = aiohttp.ClientSession()
                                           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\aiohttp\client.py", line 316, in __init__
    loop = loop or asyncio.get_running_loop()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 105, in <module>
    load_cogs()
  File "C:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 84, in load_cogs
    bot.load_extension(cog)
  File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\discord\cog.py", line 918, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\discord\cog.py", line 801, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'cogs.data_rs.logout_system' raised an error: RuntimeError: no running event loop
tacit bison
eternal steeple
#

but why its now so weird

#

i dont rally unterstand why my code before is not working anymore

tacit bison
eternal steeple
#

this is py-cord right?

sly bridge
#

I'd hope so if the server name is Pycord

tacit bison
eternal steeple
#

I mean the Code

tacit bison
#

but i didnt read all of it tbf

eternal steeple
sly bridge
#

different libraries

sly bridge
#

because discord also has a Client

tacit bison
tacit bison
sly bridge
#

so you might have imported the wrong thing

tacit bison
#

from unbelievaboat import Client

sly bridge
#

I know why

#

discord.py uses async cog loading so it makes sense it used to work with it, I assume you used it before

#

real issue here is unbelievaboats library tbh

tacit bison
sly bridge
#

yea but it's highly dumb that UB doesn't just make it's own loop