chatGPT-discord-bot icon indicating copy to clipboard operation
chatGPT-discord-bot copied to clipboard

cannot import name 'AppCommandOptionType'

Open BoredMind opened this issue 2 years ago • 2 comments

I saw this ticket but it has no real resolution other than the person changed OS versions: https://github.com/Zero6992/chatGPT-discord-bot/issues/40

I am getting the same error that person was:

Traceback (most recent call last): File "/home/pi/chatGPT-discord-bot/main.py", line 1, in <module> from src import bot File "/home/pi/chatGPT-discord-bot/src/bot.py", line 3, in <module> from discord import app_commands File "/home/pi/.local/lib/python3.10/site-packages/discord/app_commands/__init__.py", line 12, in <module> from .commands import * File "/home/pi/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 51, in <module> from ..enums import AppCommandOptionType, AppCommandType, ChannelType, Locale ImportError: cannot import name AppCommandOptionType from 'discord.enums' (/home/pi/.local/lib/python3.10/site-packages/discord/enums.py)

My OS is Raspbian GNU/Linux 10 (buster)

Name: discord.py Version: 2.1.0

Name: py-cord Version: 2.3.2

Python 3.10.7

I did try removing from discord import app_commands in bot.py just as a test and got errors related to app_commands not being defined.

BoredMind avatar Feb 09 '23 08:02 BoredMind

no longer use openAI, you can try the latest version

Zero6992 avatar Feb 10 '23 05:02 Zero6992

I am still getting this issue. Using the latest version of this repo and versions matching requirements.txt

revChatGPT==1.1.6 discord.py==2.1.0 python-dotenv==0.21.1

ImportError: cannot import name 'AppCommandOptionType' from 'discord.enums' (/home/pi/.local/lib/python3.10/site-packages/discord/enums.py)

I also tried the docker container but it does not run on Raspbian.

BoredMind avatar Feb 10 '23 17:02 BoredMind

I am still getting this issue. Using the latest version of this repo and versions matching requirements.txt

revChatGPT==1.1.6 discord.py==2.1.0 python-dotenv==0.21.1

ImportError: cannot import name 'AppCommandOptionType' from 'discord.enums' (/home/pi/.local/lib/python3.10/site-packages/discord/enums.py)

I also tried the docker container but it does not run on Raspbian.

Hi. Did you solve this issue? What helped?

Vovchanok avatar Mar 01 '23 11:03 Vovchanok