[AstroPy] importing astropy without reading the config file

Stephen Bailey stephenbailey at lbl.gov
Tue Oct 31 16:49:00 EDT 2017


Thanks Derek and Ben.

Ben's step (2) was the bit I was missing: $XDG_CONFIG_HOME/astropy/ instead
of $XDG_CONFIG_HOME/.astropy/  I had been including the extra "." and thus
not pre-creating the directory that it was looking for.  I confirm that it
also works for me with that change.

Stephen


On Tue, Oct 31, 2017 at 12:44 PM, Derek Homeier <
derek at astro.physik.uni-goettingen.de> wrote:

> 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
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20171031/e01c1ce3/attachment.html>


More information about the AstroPy mailing list