[AstroPy] importing astropy without reading the config file

Derek Homeier derek at astro.physik.uni-goettingen.de
Tue Oct 31 15:44:05 EDT 2017


On 31 Oct 2017, at 8:01 pm, Stephen Bailey <stephenbailey at lbl.gov> wrote:
> 
> For the record: setting $XDG_CONFIG_HOME did not work but I don't know why.  It didn't create any .astropy/ config files in the new location, and when I moved my $HOME/.astropy out of the way, it still created a new $HOME/.astropy/config/ directory upon import even though $XDG_CONFIG_HOME was set to a different location.  I didn't try debugging beyond that.

Looking into astropy/config/paths.py, this should be $XDG_CONFIG_HOME/astropy ,
and that directory has to already exist to be used as the config subdirectory - the docstring
of get_config_dir() can be a little bit misleading in that respect.
If setting $XDG_CONFIG_HOME should still be causing troubles and modifying your
astropy installation is an option, you might also try to hack paths.py to have get_config_dir
additionally search a third location.

HTH,
					Derek



More information about the AstroPy mailing list