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

AttributeError: module 'julia.ReactionMechanismSimulator' has no attribute 'EmptyHenryLawConstant' #2451

Closed
rwest opened this issue Jun 2, 2023 · 1 comment
Labels

Comments

@rwest
Copy link
Member

rwest commented Jun 2, 2023

Bug Description

Running RMG gives an AttributeError: module 'julia.ReactionMechanismSimulator' has no attribute 'EmptyHenryLawConstant'
(Solution is below. Sharing for posterity)

How To Reproduce

Steps to reproduce the behavior.

From the RMG-Py/examples/rmg/minimal folder running python-jl $RMGpy/rmg.py input.py I would get (after some time...)

Traceback (most recent call last):
  File "/opt/miniconda3/envs/rmg_env5/lib/python3.7/site-packages/julia/pseudo_python_[cli.py](http://cli.py/)", line 308, in main
    python(**vars(ns))
  File "/opt/miniconda3/envs/rmg_env5/lib/python3.7/site-packages/julia/pseudo_python_[cli.py](http://cli.py/)", line 59, in python
    scope = runpy.run_path(script, run_name="__main__")
  File "/opt/miniconda3/envs/rmg_env5/lib/python3.7/[runpy.py](http://runpy.py/)", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "/opt/miniconda3/envs/rmg_env5/lib/python3.7/[runpy.py](http://runpy.py/)", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/opt/miniconda3/envs/rmg_env5/lib/python3.7/[runpy.py](http://runpy.py/)", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/rwest/Code/RMG-Py/[rmg.py](http://rmg.py/)", line 118, in <module>
    main()
  File "/Users/rwest/Code/RMG-Py/[rmg.py](http://rmg.py/)", line 112, in main
    rmg.execute(**kwargs)
  File "/Users/rwest/Code/RMG-Py/rmgpy/rmg/[main.py](http://main.py/)", line 717, in execute
    self.initialize(**kwargs)
  File "/Users/rwest/Code/RMG-Py/rmgpy/rmg/[main.py](http://main.py/)", line 522, in initialize
    self.reaction_model.add_species_to_edge(spec)
  File "/Users/rwest/Code/RMG-Py/rmgpy/rmg/[model.py](http://model.py/)", line 1184, in add_species_to_edge
    self.edge.phase_system.phases["Default"].add_species(spec)
  File "/Users/rwest/Code/RMG-Py/rmgpy/rmg/[reactors.py](http://reactors.py/)", line 288, in add_species
    spec = to_rms(spc)
  File "/Users/rwest/Code/RMG-Py/rmgpy/rmg/[reactors.py](http://reactors.py/)", line 594, in to_rms
    kH = rms.EmptyHenryLawConstant()
AttributeError: module 'julia.ReactionMechanismSimulator' has no attribute 'EmptyHenryLawConstant'

Solution

I found that Pegah-B had mentioned a similar error in #2290 (comment) and said that mjohnson541's comment in #2290 (comment) had helped:

In the environment run julia to open julia and then type
] add ReactionMechanismSimulator#main
The ] will disappear after you type it.

This took about 10 minutes, to download and compile a bunch of packages, but worked.

After exiting from Julia, I once again ran python-jl $RMGpy/rmg.py input.py it ran to completion.

I was a bit surprised it was needed because I only built the environment and made all the Julia stuff last week, but if you end up here searching for something similar, it's worth a try.

Installation Information

Describe your installation method and system information.

  • OS: MacOS X, on Intel
  • Installation method: from source (current) in a recently created conda environment
  • RMG version information:
    • RMG-Py: A few commits after the current main, 3.1.0-889-gace72d4b2
    • RMG-database: on the halogen_families branch

Additional Context

Add any other context about the problem here.

@rwest
Copy link
Member Author

rwest commented Jun 2, 2023

As noted above, the solution was: in the environment run julia to open julia and then type
] add ReactionMechanismSimulator#main
The ] will disappear after you type it.
It took ~10 minutes to download and compile updated julia packages, then solved the problem.

@rwest rwest closed this as completed Jun 2, 2023
@rwest rwest added the RMS label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant