Run python file in blender from command line I have the following structure:



The repo folder is located over ~/Desktop/Github/ and when I run from the command line blender --background --python ./Desktop/Github/repo_folder/main.py I get the following error:



I want to import all the classes/functions in utils.py to main.py to do that I tried the following things:

1) from scripts.utils import * got an error that scripts module wasn't recognized.

2) moved main under scripts and edited the line from .utils import *

3) tried to create __init__.py file under scripts

I use python 3.6.8 on Ubuntu 18.04 when trying (1) no errors marks shown over the IDE (Pycharm)
Blender version - 2.8 installed using snap (if that helps)

Thank you for helping!
An example that should work with Blender 2.80:
The directory:


folder
  | -> main.py
  | -> scripts
         -> __init__.py
         -> hello.py


scripts/__init__.py:

from scripts.hello import *


scripts/hello.py:

def hello():
    print('Hi')


main.py

import bpy
import sys

if __name__ == '__main__':
    sys.path.append('')
    import scripts
    scripts.hello()


And you launch it with: blender -b -P main.py.