victorlei / smop

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

How to actually run smop after installation? #127

Open ametadope opened 6 years ago

ametadope commented 6 years ago

After installing smop through pip, how do I actually run it? There is not an example input for terminal or spyder.

victorlei commented 6 years ago

You have to figure out how to open a command line shell on your computer. Sometimes this is as trivial as CTRL-ALT-T and sometimes it is more challenging. I assume you passed this step.

On the shell say smop --version You should get the answer 0.41-beta. Assuming your matlab file is called foo.m You run smop foo.m and find the results in foo.py On Thu, Jul 19, 2018 at 2:52 AM ametadope notifications@github.com wrote:

After installing smop through pip, how do I actually run it? There is not an example input for terminal or spyder.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

-- Calligraphy of geese / Against the sky / The moon seals it / (Buson/Hass)

alay18 commented 6 years ago

I'm also having the same issue. Is there anyway I can implement this using Jupyter Notebook?

RobBW commented 6 years ago

I suggest experimenting in Jupyter with the subprocess command described here: https://docs.python.org/3/library/subprocess.html#module-subprocess

Be aware that while Smop now runs under Python 3, the code Smop currently generates still expects a python 2 environment and that running it within Python 3 may generate errors. (Eg relating to —builtins—). When I have time, I am experimenting with futurizing the generated code using the Python ⅔ tool. It’s too soon to report any successes!

I haven’t thoroughly tested my own suggestions in Jupyter yet. I am currently traveling and unable to use my iMac to verify my comments.

Regards Rob Wilkinson

On 20/07/2018, at 22:01, alay18 notifications@github.com wrote:

I'm also having the same issue. Is there anyway I can implement this using Jupyter Notebook?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

JAG1981 commented 5 years ago

Hello I still cannot run the example . Either directly site the smope folder or after having installed smop via easy install . When I use the command line smop solver.m I got the issue no such file or directory pointing to the egg file smop-0.41-py2.7.egg\smop\parsetsb.py I have python 2.7 and snip version installed is 0.41.

When directly using the smop folder and running the line “main.py solver.m “ I have some messages but then nothing happend. ( to not have errors I needed to clean the “from . “ Lines at the beginning of the depending code inside the main.py).

Thank you for your help

Ps : I’m on my mobile phone.

Lakshmikantha-nr commented 4 years ago

Hi, I am getting the following error when I run smop in Anaconda3 command prompt.

c:\users\atree\anaconda3\lib\site-packages\ply\lex.py:760: FutureWarning: Possible nested set at position 65 c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags) c:\users\atree\anaconda3\lib\site-packages\ply\lex.py:498: FutureWarning: Possible nested set at position 118 lexre = re.compile(regex, reflags) str Traceback (most recent call last): File "c:\users\atree\anaconda3\lib\site-packages\smop\main.py", line 66, in main G = resolve.resolve(stmt_list) File "c:\users\atree\anaconda3\lib\site-packages\smop\resolve.py", line 54, in resolve u = G.node[n]["ident"] AttributeError: 'DiGraph' object has no attribute 'node' Errors: 1

Please help.

adamk commented 4 years ago

Same issue. Was this ever solved?

robbiemallett commented 4 years ago

Same issue. Was this ever solved?

Me too, can you message me if you found a solution?

jesslescrimeuse commented 4 years ago

You have to change the code in the file resolve.py. Change the G.node in G.nodes.

nshaghaghi commented 4 years ago

I think I just fixed that by changing the "G.node" to "G.nodes" on lines 54 and 66 :)

alexpazolinid commented 4 years ago

Hi all, I open up Anaconda Prompt Environment, cd to smop folder (under site-packages) and still get an error : The term 'smop' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. I have installed smop via pip in my spyder console. Could anyone shed some light on that please ?

nshaghaghi commented 4 years ago

@alexpazolinid try adding the location of the smop.exe file to your path environment variable :)

alexpazolinid commented 4 years ago

@alexpazolinid try adding the location of the smop.exe file to your path environment variable :)

Hi Navid, I forgot to mention that I have smop.exe in the smop folder. Am I missing something here? To resume, I change directory to my smop folder which contains all files from pip installation as well as smop.exe Thanks mate

giuliamoscoso commented 3 years ago

Hi, I am getting the following error when I run smop in Anaconda3 command prompt.

c:\users\atree\anaconda3\lib\site-packages\ply\lex.py:760: FutureWarning: Possible nested set at position 65 c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags) c:\users\atree\anaconda3\lib\site-packages\ply\lex.py:498: FutureWarning: Possible nested set at position 118 lexre = re.compile(regex, reflags) str Traceback (most recent call last): File "c:\users\atree\anaconda3\lib\site-packages\smop\main.py", line 66, in main G = resolve.resolve(stmt_list) File "c:\users\atree\anaconda3\lib\site-packages\smop\resolve.py", line 54, in resolve u = G.node[n]["ident"] AttributeError: 'DiGraph' object has no attribute 'node' Errors: 1

Please help.

the command pip install networkx==1.11 should work, at leat with me it's solved now :)

agcala commented 1 year ago

Sometimes it gets even more challenging. Specially when you start getting this kind of messages

**Traceback (most recent call last): File "k:\anaconda\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "k:\anaconda\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "k:\anaconda\Scripts\smop.exe\__main__.py", line 4, in <module> File "k:\anaconda\lib\site-packages\smop\__init__.py", line 6, in <module> import version ModuleNotFoundError: No module named 'version'**

agcala commented 1 year ago

After installing smop through pip, how do I actually run it? There is not an example input for terminal or spyder.

There is still no answer to that.

RobBW commented 1 year ago

Have you tried reading the Smop issues list? you can find answers there.

On 3/07/2023, at 05:16, agcala @.***> wrote:

After installing smop through pip, how do I actually run it? There is not an example input for terminal or spyder.

There is still no answer to that.

— Reply to this email directly, view it on GitHub https://github.com/victorlei/smop/issues/127#issuecomment-1616738959, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRNQJWB7SAN4ECVIT4KSUTXOGUIHANCNFSM4FKWFATQ. You are receiving this because you commented.