-1

I have a bot project, here is its structure, structure

when I add it to the server I get an error, error

but on my home computer everything works fine, and with such imports imports

I tried changing the file directories but that didn't work

BeRT2me
  • 12,699
  • 2
  • 13
  • 31
Egor
  • 1
  • 1
    Does this answer your question? [Relative imports for the billionth time](https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time) – BeRT2me May 10 '23 at 04:50
  • Please provide enough code so others can better understand or reproduce the problem. – Community May 10 '23 at 05:15

2 Answers2

0

Try using:- import sys; sys.path.append("..") (assuming this error comes from main.py)

rr_goyal
  • 467
  • 2
  • 8
0

I added this code to userbot.py and it helped to find the modules

from os.path import dirname, abspath
d = dirname(dirname(abspath(__file__)))
sys.path.append(d)
Egor
  • 1