Repository for reference --> https://github.com/SavSanta/bluinfo
So, Im trying to import a class BDROM I made in the file called bluinfo.py. (line 27)
By adding the line from bluinfo import BDROM to the bluinfo-gui.py (line 8)
I am receiving ImportError: cannot import name 'BDROM'
I can not figure out how to get this badboy to work. Other posts state it may be related to PYTHONPATH (despite similar imports have been working in other parts of the program and all files are in the same directory).
I've tried to alter the import statement in the following ways to no success:
- from .bluinfo import BDROM
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named '__main__.bluinfo'; '__main__' is not a package
- from ..bluinfo import BDROM
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: attempted relative import beyond top-level package
- Creating an init.py file (which I believe I read is unnecessary in python3.x) and trying the import
$dev:/tmp/blue/bluinfo$ touch __init__.py
$dev:/tmp/blue/bluinfo$ python3 bluinfo-gui.py
Traceback (most recent call last):
File "bluinfo-gui.py", line 8, in <module>
from bluinfo import BDROM
File "/tmp/blue/bluinfo/bluinfo.py", line 8, in <module>
import ts_scanner as ScanTask
File "/tmp/blue/bluinfo/ts_scanner.py", line 5, in <module>
import ts_streamtypeclass
File "/tmp/blue/bluinfo/ts_streamtypeclass.py", line 3, in <module>
from bluinfo import BDROM
ImportError: cannot import name 'BDROM'
Any ideas appreciated!