ndeutschmann / zunis

Normalizing flows for neural importance sampling
https://zunis.readthedocs.io
MIT License
32 stars 6 forks source link

How to install dictwrapper #8

Closed xchhuang closed 3 years ago

xchhuang commented 3 years ago

Hi @ndeutschmann ,

I got errors while installing dictwrapper pip install git+https://github.com/ndeutschmann/dictwrapperas the following:

Building wheel for ruamel.yaml (setup.py) ... error
ERROR: Command errored out with exit status 1:
...

I tried on macOS and Windows 10, they have the same errors. Do you have any idea how to fix it? Thanks in advance.

NGoetz commented 3 years ago

With which version of Python did you try it? The error which occurs for me with Python 3.8 is File "/tmp/pip-install-l9mum064/ruamel.yaml/setup.py", line 69, in _convert if isinstance(node, (Str, Bytes)): NameError: name 'Str' is not defined So it is a problem related to the ruamel package, which was once broken for the latest Python version (https://bugzilla.redhat.com/show_bug.cgi?id=1714177). dictwrapper is a project by @ndeutschmann, so I am not sure, but I would guess that its dependencies need to be updated. I recommend to open an issue regarding the installation of dictwrapper in the respective repository.

xchhuang commented 3 years ago

Hi @NGoetz ,

Thanks for your reply. I am using Python 3.7.9.

I just realized that the dictwrapper package is quite simple. One easy way is to import them manually without installation.

ndeutschmann commented 3 years ago

Hi @xchhuang thanks for reporting this. Indeed in the GPU box where we actually run Zunis, we are still using python 3.6 where ruamel.yaml version 0.15.0 still did work, but it fails on 3.7+. We were explicitly using this version due to the warning on the package's page that they will at some point drop the API inherited from pyyaml and that the new one being implemented from 0.15.x on is not guaranteed to be stable.

The documentation is not super clear, however it seems least the current version of ruamel (0.16.12) is still retro-compatible. I have not yet conducted extensive testing so this is not officially released, however you can already use the following:

pip install pip install git+https://github.com/ndeutschmann/dictwrapper@ruamel_0.16.12

xchhuang commented 3 years ago

Hi @ndeutschmann ,

It seems to work now, thank you!

ndeutschmann commented 3 years ago

Hi again

I implemented a few basic unit tests in dictwrappers to make sure that the yaml import API is working with version 0.16.2 and indeed it seems to be the case so we will stick with that for now.

As a result, we now have

@xchhuang Could you please check whichever of these suits you?

xchhuang commented 3 years ago

Hi @ndeutschmann ,

I am using anaconda 4, python3.7 and I checked that all 3 ways can work for me in macOS and Windows 10. Thanks.

ndeutschmann commented 3 years ago

Great, thanks for checking