Windows上用于geotiler的.config的位置

时间:2018-07-24 09:41:22

标签: matplotlib jupyter-notebook matplotlib-basemap

我正在使用matplotlib底图在Windows上的jupyter笔记本中工作,我想对底图使用geotiler。我正在编写一个程序,作为程序的一部分,它将生成一个地图并在其上绘制数据点。但是,我的代码生成的地图通常只占一小部分,并且没有定义功能。我的解决方案是导入geotiler库,并将其显示在带有alpha的地图上,以便可以识别生成的地图。但是,当我使用geotiler.Map()函数时,收到一条消息,指出配置文件不存在。


The code and the error message


如何在Windows上找到.config文件夹(如果存在),以及如果不存在该在哪里创建?我已经尝试过我的用户文件夹,但是似乎没有用。预先感谢。

1 个答案:

答案 0 :(得分:0)

Figured it out.

The read_config() method in the source code tries to get the HOME environment variable, which for Windows is blank, and appends the path for the config to that. Importing os and manually setting the HOME variable to wherever you placed your .config folder seems to do the trick. You can do this with os.environ['HOME'] = 'C:\Users\YourName'.