2

python 3.7.7 and also tried on python 3.6.0

I am using Django server, and in my views.py

I am trying to get my function that in the detector.

By file when I try to import my detector file:

from ..DataFromSkyDetector import Detector
ValueError: attempted relative import beyond top-level package

it's raised this error:

ValueError: attempted relative import beyond top-level package

I am adding a picture of the hierarchy,

I already added all the routes init.py.

i, I made my detector file as a package and return it to a file,

I read every stackoverflow question that regarded to this problem.

photo

Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
DataSet
  • 21
  • 2

1 Answers1

0

Add

del sys.path[0]
sys.path.insert(0,'Datafromskydetector file address ')
 import DataFromSkyDetector 

or look up this Link and valueeroor for some help.

Gautamrk
  • 1,144
  • 9
  • 12