Running Henry on Windows

Dawid
Participant V

I saw on GitHub that Henry won’t even run because some problems with escaping arguments from settings.json when path to a config file contains backslashes.

When can we expect a fix for that? I would like to use Henry on Windows

0 14 440
14 REPLIES 14

Dawid, could you open an issue for this on the Github repo so it’s more formally tracked? I don’t use a Windows machine so Windows glitches aren’t always visible to me. I am currently working on an update for Henry that will be published soon and it may resolve this issue. I will figure out how to test on Windows before release so that I can say one way or the other. Windows support isn’t currently guaranteed, but we’d obviously like Henry to be usable on any platform.

Also, remember that Henry is fully open source and community supported, which means if you see something broken, you could dive into the code and take a stab at it yourself! We love community PRs.

Dawid
Participant V

Hi @jax1

I believe somebody opened it already: https://github.com/looker-open-source/henry/issues/9 if it is indeed the same issue. I’m getting an error that I am not sure what it means

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

is the error even while running henry --help

Dawit, I just pushed an update which I managed to successfully use on Windows. Try installing the new version and let me know how it goes.

Dawid
Participant V

Okay I got the 0.2 wheel but now I guess I need to change Python as I have 3.8.1 😃

Shouldn’t it be a requirement of at least 3.7 or does it have to be exactly 3.7?

It has to be >=3.7 but <3.8.

Dawid
Participant V

Any specific reason for not being able to run it on 3.8?

It’s because Henry makes use of the new python Looker SDK which relies on cattrs, a data structuring/un-structuring library which requires us to pin the version of the Python SDK to version 3.7.x until it starts supporting 3.8. That being said, there are libraries like pyenv that help you manage multiple python versions very easily.

Dawid
Participant V

Sure, I have no problem chaning versions… this was just my sheer curiosity. Thanks @jax1 I’ll try it now and report back about its usage on Windows

Sounds good, thank you for understanding. I look forward to hearing back! 🙂

Dawid
Participant V

I am getting some errors runing henry analyze explores. AssertionError to be exact. Is there a way for me to debug it to find out what explore is causing this? I would definitely be interested in learning more about the tool and hopefully help in its development…

Dawid, that would be great! You can try narrowing down which explore it is by using the --model and --explore arguments to filter.

Thanks to Dawid’s debugging I have just pushed a fix for this. It was happening on explores containing only dimensions (or only measures).

Dawid
Participant V

Just for everybody’s information, I ran the newest version on Windows and everything is working as expected, even with dimensions-only or measures-only explores.

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

The error message you're seeing indicates that Python encountered a string with a Unicode escape sequence that is truncated, meaning it doesn't have the required number of hexadecimal digits. The position 2-3 in the error message refers to the location in the string where the error occurred.

You can solve this error "codec can't decode bytes" by using a raw string by prefixing your string with the letter "r". Raw strings don't interpret backslashes as escape characters.
 
path = r"C:\Users\User\Documents\file.txt"

Double the backslashes in your string
 
path = "C:\\Users\\User\\Documents\\file.txt"

Use forward slashes instead of backslashes
 
path = "C:/Users/User/Documents/file.txt"

Unicode escape sequences can be used in both single-quoted ('...') and double-quoted ("...") strings in Python. However, it's important to note that in Python 3, strings are Unicode by default, so you can also include Unicode characters directly in a string without using escape sequences, as long as you use the appropriate character encoding.