0

I have two python files :

DatabaseFunctions.py and tele_bot.py .

On windows side I'm importing DatabaseFunctions.py module inside tele_bot.py and everything is fine .

import code line : from .DatabaseFunctions import *

when I upload my files in ubuntu server side , I'm getting this error :

SystemError: Parent module '' not loaded, cannot perform relative import

I also tried from appname.DatabaseFunction import * then I got this :

No module named 'appname'

Here is my directory structure :

firstBot/
      __init__.py
      DatabaseFunctions.py
      tele_bot.py

anyone can help ?

toti08
  • 2,448
  • 5
  • 24
  • 36
Mehdi bahmanpour
  • 574
  • 7
  • 21

1 Answers1

0

Did you tried to use

import firstBot.DatabaseFunctions

This should work on windows or linux. But i would recommend to use lowercase file- and foldernames like firstbot/database_functions.py, so it may look like that:

from firstbot.database_functions import *
ecoron
  • 36
  • 1