victorlei / smop

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

ImportError on windows #185

Open calmymail opened 2 years ago

calmymail commented 2 years ago

I successfully installed smop. But when I run with command in poweshell:

smop> python main.py -h

I get the error:

Traceback (most recent call last): File "G:\Teaching-CAL\Codes-Teaching\000 CFD\GITHUB\smop\smop\main.py", line 15, in from . import options ImportError: attempted relative import with no known parent package

Suggestions?

berlinpolin commented 2 years ago

I remove the relative import.

For example, from . import options -> import options or from . node import extend,exceptions -> from node import extend,exceptions

The error can be solved. But I have no ideal how to get the correct output python file

calmymail commented 2 years ago

Thanks for the reply. Still can’t get this to work. Do you have a current version that works with Python 3?

From: berlinpolin @.> Sent: Wednesday, August 3, 2022 1:00 AM To: victorlei/smop @.> Cc: calmymail @.>; Author @.> Subject: Re: [victorlei/smop] ImportError on windows (Issue #185)

I remove the relative import.

For example, from . import options -> import options or from . node import extend,exceptions -> from node import extend,exceptions

The error can be solved. But I have no ideal how to get the correct output python file

— Reply to this email directly, view it on GitHub https://github.com/victorlei/smop/issues/185#issuecomment-1203518127 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJ6P2JDW6EBEWAHJ4YCVDTVXIDHNANCNFSM54QEVA2Q . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AHJ6P2M73Z7EDHWTZ6CCBPLVXIDHNA5CNFSM54QEVA22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI66DVLY.gif Message ID: @. @.> >

berlinpolin commented 2 years ago

I use python 3.9.13. Which version do you use?