I'm trying to use a package that has the following structure:
The file prova.py contains only the following line:
import bipartite_class
while bipartite_class.py has the following initial lines:
from .nes import *
from .mod import *
from .graphs import *
from .contrib import *
from .null import *
from .tests import *
from getref import *
import pickle
import tempfile
import os
import numpy as np
import networkx as nx
import os.path
When I try to compile prova.py I get the following error:
Traceback (most recent call last):
File "prova.py", line 1, in <module>
import bipartite_class
File "/Desktop/CD_BEST/Bipartito/bipy-master/bipy/bipartite_class.py", line 1, in <module>
from .nes import *
ValueError: Attempted relative import in non-package
If I try to remove the dots in bipartite_class.py I get:
Traceback (most recent call last):
File "prova.py", line 1, in <module>
import bipartite_class
File "/Desktop/CD_BEST/Bipartito/bipy-master/bipy/bipartite_class.py", line 1, in <module>
from nes import *
File "/Desktop/CD_BEST/Bipartito/bipy-master/bipy/nes/_init_.py", line 5, in <module>
from nodf import *
File "/Desktop/CD_BEST/Bipartito/bipy-master/bipy/nes/nodf.py", line 3, in <module>
from ..mainfuncs import *
ValueError: Attempted relative import beyond toplevel package
What should I do?