You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing Astropy on my system takes anywhere between 3-5 minutes due to checking the wrong network location for its Home directory.
The OS is Windows 10 1809 (the vast majority of users here are not comfortable with Linux environments), so os.name = 'nt'
The code in config.paths._find_dir() relies on the contents of os.environs. It searches for 'MSYSTEM' (does not exist), then 'HOMESHARE', which does. It then attempts to find %HOMESHARE%\.astropy, which does not exist and never will. %HOMESHARE% = \\server_root\, and I obviously do not have write permissions to create \\server-root\.astropy. Python hangs for several minutes waiting to timeout as it attempts to access \\server-root\.astropy\
It should instead attempt to find %HOMESHARE%\%HOMEPATH%\.astropy = \\server-root\user-name\.astropy, which does exist - or at least, will have write permission available. This would be equivalent to how the next IF statement uses the environment variable HOMEPATH.
Yes, that executes pretty much instantly as well. It resolves to C:\Users\<user-name>\AppData\Local\.
Note that the behaviour is different in that it resolves to a location in %HOMEPATH%, rather than %HOMESHARE%. That won't affect me - I don't modify any of Astropy's configuration files - but presumably it will for others.
Activity
Cadair commentedon May 20, 2019
Out of interest does https://github.com/ActiveState/appdirs do this correctly? I am planning on moving over to appsdirs see: #8245
simon-ball commentedon May 20, 2019
import appdirsruns in ~10ms, it seems to be limited by the time to update the command prompt as much as anything else.Cadair commentedon May 20, 2019
Does calling
appdirs.user_config_dir()work in good time?simon-ball commentedon May 20, 2019
Yes, that executes pretty much instantly as well. It resolves to
C:\Users\<user-name>\AppData\Local\.Note that the behaviour is different in that it resolves to a location in %HOMEPATH%, rather than %HOMESHARE%. That won't affect me - I don't modify any of Astropy's configuration files - but presumably it will for others.
Cadair commentedon May 20, 2019
Yeah I expect some subtle changes in semantics, but it should be much more reliable.
pllim commentedon Sep 2, 2020
#8245 is still unresolved. Meanwhile, is #10705 good enough for now?
embray commentedon Sep 22, 2020
This is fixed by #10705, as the
HOMESHAREenvironment variable is no longer used to determine the user's home directory on Windows.