victorlei / smop

Small Matlab to Python compiler
MIT License
1.08k stars 409 forks source link

ValueError: Attempted relative import in non-package #132

Open ghost opened 6 years ago

ghost commented 6 years ago

Good morning, I have an error that I didn't find in the other issues. When I run smop from the terminal this error appears :

TimNemo:smop Tim$ python main.py solver.m Traceback (most recent call last): File "main.py", line 15, in from . import options ValueError: Attempted relative import in non-package

I thought maybe it was a version problem, so I changed my version of python and I tried to change the syntax to " from options import ; from node import " etc.. but nothing to do. My version of python is Python 2.7.15 :: Anaconda, Inc. I also use libermate to quickly transform matlab code but other problems appear Could you help me please ? Thanks :D

ghost commented 6 years ago

It's good, I found the issue. it's just $sudo smop solver.m However I would like to point out that there are differences between the versions, the translation is not the same with smop==0.31 and smop==0.41. Thank's @victorlei for this incredible tool.

geraman21 commented 3 years ago

@flickfluck Hey man I am struggling with the same error. Could ypu please explain in greater details how exactly do you use the tool ? I am trying to run main.py and getting this error...