Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RMS error after commit 437739 #2290

Closed
alirmg opened this issue Apr 2, 2022 · 17 comments · Fixed by #2415
Closed

RMS error after commit 437739 #2290

alirmg opened this issue Apr 2, 2022 · 17 comments · Fixed by #2415
Labels

Comments

@alirmg
Copy link

alirmg commented Apr 2, 2022

I have just pulled the most recent RMG-Py and RMG-Database from git. when I run the superminimal example, I get the following error (full text below). (for both superminimal example and any other input files I generated) NameError: name 'rms' is not defined

@alirmg alirmg changed the title I have just pulled the most recent RMG-Py and RMG-Database from git. when I run the superminimal example, I get the following error (full text below). Prior to this, my install was working (for both superminimal example and any other input files I generated) NameError: name 'rms' is not defined I have just pulled the most recent RMG-Py and RMG-Database from git. when I run the superminimal example, I get the following error (full text below). (for both superminimal example and any other input files I generated) NameError: name 'rms' is not defined Apr 2, 2022
@mjohnson541
Copy link
Contributor

The environment has been updated. You need to reinstall see: http://reactionmechanismgenerator.github.io/RMG-Py/users/rmg/installation/anacondaDeveloper.html

@IannLiu
Copy link

IannLiu commented Apr 3, 2022

The environment has been updated. You need to reinstall see: http://reactionmechanismgenerator.github.io/RMG-Py/users/rmg/installation/anacondaDeveloper.html

Hi, I got the same error after running the superminimal example. However, another error,
AttributeError: module 'julia.ReactionMechanismSimulator' has no attribute 'EmptyHenryLawConstant' occurred after installing and linking Julia dependencies.

@mjohnson541
Copy link
Contributor

Okay, in the environment run julia to open julia and then run

] add ReactionMechanismSimulator#main

The ] will disappear after you type it.

@xiaoruiDong
Copy link
Contributor

@ChrisBNEU Hi Chris, I remembered you brought up this (or something similar) during the developer hour this week (Apr 4, 2022). Can you update here with what you found and what troubleshooting you have done? If there is a PR related please link it as well. Many thanks!

@xiaoruiDong xiaoruiDong changed the title I have just pulled the most recent RMG-Py and RMG-Database from git. when I run the superminimal example, I get the following error (full text below). (for both superminimal example and any other input files I generated) NameError: name 'rms' is not defined RMS error after commit 437739 Apr 6, 2022
@ChrisBNEU
Copy link
Contributor

ChrisBNEU commented Apr 6, 2022

So far, the problem appears to be that the ReactionMechanismSimulator package in julia does not update with the main branch of the RMS github repo, despite it being specified in the pyrms wrapper. Have not started a PR, the farthest I have gotten with it is it is we could solve it in the install step for julia:

julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",version="0.4")); ...'

I think we can specify this instead:

julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); ...'

although we should not need to do this, again since the repo is specified in pyrms. I have not gotten to the root cause of that yet.

@Pegah-B
Copy link

Pegah-B commented Apr 25, 2022

Hi, I have the similar issue on my mac 10.14.6 after installing the latest version of RMG (3.1.0) by pulling the most recent RMG-Py and RMG-Database from git. just according to the updated instruction as mentioned in "#2290 (comment)".
Running the minimal example of Ethane pyrolysis or any other input result in the error "NameError: name 'rms' is not defined". How should I fix the error?

@mjohnson541
Copy link
Contributor

  1. If inside the rmg_env you run conda list and pyrms isn't in the dependencies you need to rebuild the rmg_env environment, there are faster ways to do this than entirely reinstalling, but entirely reinstalling is probably the easiest and least prone to error.
  2. You should be launching RMG with python-jl now rather than python.
  3. If the issue is none of the above activate the RMG environment and run:
    julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main"));

@Pegah-B
Copy link

Pegah-B commented Apr 25, 2022

1- What I see in the list at the moment is:
pyrms 0.1.2 no_rmg_dep rmg
I did entirely reinstall it on the weekend and I still got the same error NameError: name 'rms' is not defined afterwards.
2- I already used python-jl.
3- I've just done it, but the same error still pops up for me.

@mjohnson541
Copy link
Contributor

Run
python-jl -c "from pyrms import rms"
and post the error trace you get.

@Pegah-B
Copy link

Pegah-B commented Apr 25, 2022

This is the result:

(rmg_env) Pegahs-MacBook-Pro:~ Pegah$ python-jl -c "from pyrms import rms"
Traceback (most recent call last):
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 308, in main
    python(**vars(ns))
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 52, in python
    exec(command, scope)
  File "<string>", line 1, in <module>
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/pyrms/rms.py", line 6, in <module>
    from julia import Main
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/core.py", line 246, in load_module
    JuliaMainModule(self, fullname))
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/core.py", line 148, in __init__
    self._julia = loader.julia
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/core.py", line 238, in julia
    self.__class__.julia = julia = Julia()
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/core.py", line 471, in __init__
    self.api = LibJulia.from_juliainfo(jlinfo)
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/libjulia.py", line 195, in from_juliainfo
    sysimage=juliainfo.sysimage,
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/libjulia.py", line 217, in __init__
    setup_libjulia(self.libjulia)
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/libjulia.py", line 34, in setup_libjulia
    libjulia.jl_.argtypes = [c_void_p]
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__
    func = self.__getitem__(name)
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/ctypes/__init__.py", line 382, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x11512df80, jl_): symbol not found

@mjohnson541
Copy link
Contributor

Hmm...I'm not sure what's happening there. It looks like it's erroring on from julia import Main in pyjulia so it doesn't look like an inherent pyrms issue. Can you try python-jl -c "from julia import Main"?

@Pegah-B
Copy link

Pegah-B commented Apr 25, 2022

Still the same:

(rmg_env) Pegahs-MBP:~ Pegah$ python-jl -c "from julia import Main"
Traceback (most recent call last):
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 308, in main
    python(**vars(ns))
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 52, in python
    exec(command, scope)
  File "<string>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/core.py", line 246, in load_module
    JuliaMainModule(self, fullname))
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/core.py", line 148, in __init__
    self._julia = loader.julia
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/core.py", line 238, in julia
    self.__class__.julia = julia = Julia()
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/core.py", line 471, in __init__
    self.api = LibJulia.from_juliainfo(jlinfo)
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/libjulia.py", line 195, in from_juliainfo
    sysimage=juliainfo.sysimage,
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/libjulia.py", line 217, in __init__
    setup_libjulia(self.libjulia)
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/libjulia.py", line 34, in setup_libjulia
    libjulia.jl_.argtypes = [c_void_p]
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__
    func = self.__getitem__(name)
  File "/Users/Pegah/opt/anaconda3/envs/rmg_env/lib/python3.7/ctypes/__init__.py", line 382, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x1104f8f80, jl_): symbol not found

@mjohnson541
Copy link
Contributor

It must a Julia or pyjulia issue. What Julia version are you using?

@Pegah-B
Copy link

Pegah-B commented Apr 26, 2022

It is Julia Version 1.7.2 (2022-02-06).
How could I fix that then?

@mjohnson541
Copy link
Contributor

I'm not sure, are you on an M1 mac? We've had a lot of trouble with installs on those.

You can try installing the latest Julia 1.6 instead, which we've tested a lot more than Julia 1.7. If that doesn't work, I'm not sure what to do beyond opening an issue on pyjulia. If you have access to a linux computer or kernel the install for linux is pretty reliable since we package our own julia conda binaries with it.

@Pegah-B
Copy link

Pegah-B commented Apr 27, 2022

Thanks a lot. As you suggested, uninstalling Julia 1.7 and following the process again with Julia 1.6 this time, I did not get the error NameError: name 'rms' is not defined anymore. I just faced the error AttributeError: module 'julia.ReactionMechanismSimulator' has no attribute 'EmptyHenryLawConstant' which got fixed at once by what you commented earlier at #2290 (comment). Everything works pretty well now. I wanted to share my experience here and thank you again for your help.

@ChrisBNEU
Copy link
Contributor

ChrisBNEU commented May 9, 2022

I tried a clean install using the developer instructions, with the modification to the rms install step:

julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator;'

It worked fine when I did that, I opened PR #2305 to discuss this change. maybe it would be good to also include a caveat for V1.7 of julia, not sure if that is just a Mac/M1 chip issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants