New Fireworks installation bugs

Hi y’all,

I encountered a bug when created a new conda environment for atomate2/fireworks. When I try to install fireworks with pip install fireworks, everything successfully installs. But when I try to run various commands I get errors I haven’t seen before.

Errors:

  1. lpad webgui returns ImportError: cannot import name 'Markup' from 'flask' (/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/flask/__init__.py)

  2. lpad rerun_fws -s FIZZLED returns TypeError: RelaxSetGenerator.__init__() got an unexpected keyword argument 'auto_kspacing'

Steps to reproduce:

  • new conda env
  • pip install “atomate2[strict]”
  • pip install fireworks

Any idea what’s going wrong?

Thanks,

Kat Nykiel

  1. For the first error, did you try anything to fix? e.g. Googling there are several threads like: python - ImportError: cannot import name 'Markup' from 'jinja2' - Stack Overflow

  2. The second error looks to be an atomate error

For your 1st error:
Have you specified the Launchpad via the environment variable, or is it already present in your current directory from where you are running lpad webgui? If not, then you should follow this link in order to be able to use lpad webgui command

If you are still getting the same error after correctly running lpad webgui, try downgrading flask to 2.3.1, and rerun lpad webgui

For the 2nd error:
Can you pls post a detailed snapshot of the error so that I can help debug?

Dr. Jain,

Thanks for the quick response!

  1. I had previously tried the following to fix it:

    • downgrading to Flask 2.0.3 led to a different error:
      ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/werkzeug/urls.py)

    From your link, I found that adding from markupsafe import Markup to /home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/flask/__init__.py resolved the issue, using flask-3.0.0

  2. I’ll look into this as well and see if I can find the issue.

Best,

Kat Nykiel

Hrushikesh,

Thanks for the quick response!

  1. See my last comment to Dr. Jain, I believe it was an issue with FireWorks itself and not my lpad configuration. I was still able to run commands such as lpad get_wfs without issue.

  2. As requested, here’s the full error:

(/home/knykiel/.conda/envs/2022.10-py39/atomate) lpad rerun_fws -s FIZZLED
Traceback (most recent call last):
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/bin/lpad", line 8, in <module>
    sys.exit(lpad())
             ^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/scripts/lpad_run.py", line 1553, in lpad
    args.func(args)
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/scripts/lpad_run.py", line 643, in rerun_fws
    lp.rerun_fw(int(f), recover_launch=l, recover_mode=args.recover_mode)
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/core/launchpad.py", line 1716, in rerun_fw
    updated_ids = wf.rerun_fw(fw_id)
                  ^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/core/firework.py", line 1016, in rerun_fw
    m_fw._rerun()
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/core/launchpad.py", line 2075, in _rerun
    self.full_fw._rerun()
    ^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/core/launchpad.py", line 2175, in full_fw
    self._get_launch_data(launch_field)
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/core/launchpad.py", line 2190, in _get_launch_data
    fw = self.partial_fw  # assure stage 1
         ^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/core/launchpad.py", line 2168, in partial_fw
    self._fw = Firework.from_dict(data)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 159, in _decorator
    new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 159, in <dictcomp>
    new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
                      ^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 120, in _recursive_load
    return {k: _recursive_load(v) for k, v in obj.items()}
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 120, in <dictcomp>
    return {k: _recursive_load(v) for k, v in obj.items()}
               ^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 123, in _recursive_load
    return [_recursive_load(v) for v in obj]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 123, in <listcomp>
    return [_recursive_load(v) for v in obj]
            ^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 115, in _recursive_load
    return load_object(obj)
           ^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 337, in load_object
    return cls_.from_dict(obj_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 159, in _decorator
    new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 159, in <dictcomp>
    new_args[0] = {k: _recursive_load(v) for k, v in args[0].items()}
                      ^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/fireworks/utilities/fw_serializers.py", line 118, in _recursive_load
    return json.loads(json.dumps(obj), cls=MontyDecoder)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 497, in decode
    return self.process_decoded(d)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 443, in process_decoded
    return cls_.from_dict(data)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 194, in from_dict
    decoded = {k: MontyDecoder().process_decoded(v) for k, v in d.items() if not k.startswith("@")}
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 194, in <dictcomp>
    decoded = {k: MontyDecoder().process_decoded(v) for k, v in d.items() if not k.startswith("@")}
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 405, in process_decoded
    obj = self.process_decoded(d["@bound"])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 443, in process_decoded
    return cls_.from_dict(data)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 194, in from_dict
    decoded = {k: MontyDecoder().process_decoded(v) for k, v in d.items() if not k.startswith("@")}
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 194, in <dictcomp>
    decoded = {k: MontyDecoder().process_decoded(v) for k, v in d.items() if not k.startswith("@")}
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 443, in process_decoded
    return cls_.from_dict(data)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/knykiel/.conda/envs/2022.10-py39/atomate/lib/python3.11/site-packages/monty/json.py", line 195, in from_dict
    return cls(**decoded)
           ^^^^^^^^^^^^^^
TypeError: RelaxSetGenerator.__init__() got an unexpected keyword argument 'auto_kspacing'

Best,

Kat Nykiel

Hi Kat,
Did you try downgrading flask to 2.3.1 instead of 2.0.3 to solve your first error?