tkrajina / srtm.py

Geo elevation data parser for "The Shuttle Radar Topography Mission" data
Apache License 2.0
240 stars 57 forks source link

[WinError 53]:The network path on WINDOWS-10 machine #46

Closed vignesh1987 closed 4 years ago

vignesh1987 commented 4 years ago

Hi, I am trying to test the ridge_map package. But I get a windows error when I try the first steps as described on the Github page [WinError 53] The network path was not found: '\\.cache\srtm' ridge map error

I ran it through the Ridge map creator. He suggested some changes to the srtm.py code, which is creating this issue on WINDOWS 10 machines. But it did not solve my problem. Can you help?

best Vignesh

tkrajina commented 4 years ago

I pushed a new commit on master now. Can you try if it fixes your problem

vignesh1987 commented 4 years ago

Hi, I uninstalled the older version (srtm.py) and reinstalled the master version from Github. I get the following (same) error image

tkrajina commented 4 years ago

OK, two things, first can you start python in interactive mode and try:

$ python
Python 3.7.3 (default, Nov 15 2019, 04:04:52) 
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ.get("HOME")
'/Users/usr'
>>> os.environ.get("HOMEPATH")
>>> import pathlib
>>> pathlib.Path.home()
PosixPath('/Users/usr')

...and paste the results. To me, it seems like Python detects that your home directory is \\ and that (it I remember correctly) is the prefix for network drives, not a valid directory path.

Second, I pushed another commit, it will fail again, but I'm interested in the error message it fails with.

And third. I added a new parameter to use a custom local cache directory (that's the directory SRTM files are stored). See https://github.com/tkrajina/srtm.py/blob/master/example.py -- can you try if this works for you?

vignesh1987 commented 4 years ago

Hi, The python command gives me the following output. you were correct about the home directory (\) image

The second option fails as well with a similar message image

The third local cache directory works image

tkrajina commented 4 years ago

Ah, OK, I see.

I pushed another change (https://github.com/tkrajina/srtm.py/commit/075126875bedbee0f23676f4a8159c6240398a95) which should fix the library even without the custom directory.