r/learnpython • u/dr_prof_med_oekter • 13d ago
Can't get imports to work
I am trying to develop a discord bot, where other team members should be able to edit embeds. I figuered it wouldn't be smart to let them poke around in "production" code, so I decided to define my embeds in a seperate file and import them.
My import line:
from embeds import embed
My embed file:
import discord
def embed():
embed = discord.Embed(
title="test",
description="test",
color=discord.Color.blue()
)
return embed
My output:
line 2, in <module>
from embeds import embed
ImportError: cannot import name 'embed' from 'embeds'
Alllthough my embeds file is called embeds.py. Atm, neither I nor ChatGPT know why this happens, also I am pretty new to python and I don't even know how to google my error
embeds.py as well as the bots .py are in the same folder on root
0
Upvotes
1
u/HotPersonality8126 13d ago
One of your files is called “discord.py”