discord-py-ui / discord-ui

A discord.py extension for sending, receiving and handling ui interactions in discord
https://discord-ui.rtfd.io/
MIT License
36 stars 9 forks source link

Unable to import the module [vs code and the package itself] #112

Closed EpicBirb closed 2 years ago

EpicBirb commented 2 years ago

VS code: image

Python interpreter: image

EpicBirb commented 2 years ago

also. without using import discord_ui it will have the NoModuleFoundError because of line 29

RedstoneZockt commented 2 years ago

Can u try to remove the .client after discord_ui? so: from discord_ui import UI

kvsxxx commented 2 years ago

seems like imports in nextcord are a bit different, I'll fix that, sorry for the trouble

kvsxxx commented 2 years ago

alrighty, that issue should be fixed in v5.1.2, thanks for reporting and sorry for the wait.

I'll leave this issue open in case the issue should still exsist or you still got any problems, if it's fixed for you, just close the issue :)

EpicBirb commented 2 years ago

image

Can u try to remove the .client after discord_ui? so: from discord_ui import UI

EpicBirb commented 2 years ago

Failed to import discord_ui on 5.1.2

image

EpicBirb commented 2 years ago

More context for above screenshot: image

kvsxxx commented 2 years ago

can you import discord? A discord package sould be installed together with nextcord for migration support ('alias'). It seems that the discord package is not existing ('discord' (unknown location))

can you try a simple import and tell me the output?

import discord
from discord import __version__
EpicBirb commented 2 years ago

can you import discord? A discord package sould be installed together with nextcord for migration support ('alias'). It seems that the discord package is not existing ('discord' (unknown location))

can you try a simple import and tell me the output?

import discord
from discord import __version__

image

kvsxxx commented 2 years ago

huh that's weird. Can you try to reinstall nextcord? I tried reproducing that and in my case both imports didn't raise any exceptions.

py -3.10 -m pip uninstall nextcord && py -3.10 -m pip install nextcord

My ouput was:

Python 3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import discord
>>> from discord import __version__
>>>

Btw thank you very much for your patience!

EpicBirb commented 2 years ago

It works perfectly now, thank you :D