Premise: I use Python 3.9.0 on a MacOS with Mojave (version 10.14.5).
The paper "Network Inference via the Time-Varying Graphical Lasso" by David Hallac, Youngsuk Park, Stephen Boyd, Jure Leskovec comes with a Python code which can be found at https://github.com/davidhallac/TVGL. I tried to run the file exampleTVGL.py with Python IDLE but I have the following issues:
- It seems to be written in Python2 language, so I converted it in Python3 language with 2to3 command in the terminal;
- Then, when running exampleTVGL.py I got the error:
"SyntaxError: import * only allowed at module level"
which I tried to solve by replacing:
from <modulename> import *
with
import <modulename>
*** update: not even this point is working, cannot substitute like this in order to import all from a module; How, so?
- Then two modules were missing (snap and cvxpy), so I installed them in the terminal;
- Last I got the error:
NameError: name 'TUNGraph' is not defined
I see that David Hallac himself on GitHub issues page suggests to solve the error by installing snap package, but on my computer the requirement is already satisfied and still not working.
What am I doing wrong? I tried use Python2, but was not able to install it, although not sure this would be sufficient to solve all issues. How can I solve the NameError 'TUNGraph" problem? Do you have any suggestion on how could I run more efficiently the code without experimenting issues?
Thank you