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

ete4 Windows Install Error: KeyError 'HOME' #763

Open
Anthony-J-G opened this issue Nov 11, 2024 · 0 comments
Open

ete4 Windows Install Error: KeyError 'HOME' #763

Anthony-J-G opened this issue Nov 11, 2024 · 0 comments

Comments

@Anthony-J-G
Copy link

Hi all!

Was trying to mess around with using the package inside of a fresh version of Windows 11 and a virtual environment generated via (Python 3.13.0)

python -m .venv venv

While trying to simply import the install that I got via pip install https://github.com/etetoolkit/ete/archive/ete4.zip earlier today,

from ete4 import Tree

I was met with a KeyError.

It was complaining specifically that File c:\<path-to-project>\.venv\Lib\site-packages\ete4\smartview\renderer\layouts\ncbi_taxonomy_layouts.py:7 was throwing a KeyError specifically in the line

return os.environ.get(xdg_var, os.environ['HOME'] + default) + '/ete'

after calling the function

def ete_path(xdg_var, default)

According to a little bit of research that I found on stack overflow it seems like this is an issue with differences between the Windows and Linux filesystem. After following the advice on stack overflow and manually changing ete_path(xdg_var, default) to be,

# Helper function to define global ETE_* variables.
def ete_path(xdg_var, default):
    return os.environ.get(xdg_var, os.path.expanduser('~') + default) + '/ete'

things seem to be working as normal.

Now I did a very minimal amount of effort to try to fix this so I'm very unsure if this is a breaking change across other files but I haven't hit any yet. Wanted to bring this up however to see if this was a common problem or something that you guys were aware about.

Thanks in advance for your time, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant