Psycojoker / prosopopee

a static website generator to make beautiful customizable pictures galleries that tell a story
http://prosopopee.readthedocs.org
GNU General Public License v3.0
326 stars 56 forks source link

Python error on macOS #154

Open sisyphosloughs opened 6 months ago

sisyphosloughs commented 6 months ago

Hi all,

I followd the instructions for macos: https://prosopopee.readthedocs.io/en/latest/install.html#mac.

When I try to launch prosopopee test I get this error:

2024-03-10 17:56:31,438 ERROR (utils.py:85) - 
"safe_load()" has been removed, use

  yaml = YAML(typ='safe', pure=True)
  yaml.load(...)

instead of file "/Users/bbruecker/tmp/Prosopopee/ve/lib/python3.12/site-packages/prosopopee/utils.py", line 72

            gallery_settings = yaml.safe_load(settings.read())

Traceback (most recent call last):
  File "/Users/bbruecker/tmp/Prosopopee/ve/lib/python3.12/site-packages/prosopopee/utils.py", line 72, in load_settings
    gallery_settings = yaml.safe_load(settings.read())
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bbruecker/tmp/Prosopopee/ve/lib/python3.12/site-packages/ruamel/yaml/main.py", line 1105, in safe_load
    error_deprecation('safe_load', 'load', arg="typ='safe', pure=True")
  File "/Users/bbruecker/tmp/Prosopopee/ve/lib/python3.12/site-packages/ruamel/yaml/main.py", line 1039, in error_deprecation
    raise AttributeError(s, name=None)
AttributeError: 
"safe_load()" has been removed, use

  yaml = YAML(typ='safe', pure=True)
  yaml.load(...)

instead of file "/Users/bbruecker/tmp/Prosopopee/ve/lib/python3.12/site-packages/prosopopee/utils.py", line 72

            gallery_settings = yaml.safe_load(settings.read())

Any ideas?

dani-corie commented 3 months ago

This is due to a breaking change in the yaml module. You will need to use the latest version from git. Just get it, and install by running pip install -e {prosopopee project folder} inside your venv.

Note that at the moment you'll also likely run into issue #147, so you'll have to manually downgrade jinja2 by running pip install jinja==3.0.3.