I do have all of those files in the session dir. Running that last bit of code works well, though I don’t know what it’s doing.
Regarding where the problem might lie, I think it has something to do with how gmt calls gs. I tried running some gmt code with .ps output
gmt psbasemap -R0/1/0/1 -JX1 -Baf -Vi > test.ps
and it worked just fine, with the expected output. Trying to convert it via psconvert, however, ran into the same problem
(cin2020) C:\Users\fedes>gmt psconvert test.ps -A -Tg
El sistema no puede encontrar la ruta especificada.
El sistema no puede encontrar la ruta especificada.
psconvert [ERROR]: System call [@"C:/Users/fedes/anaconda3/envs/cin2020/Library/bin/gswin64c.exe" -q -dNOSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -DPSL_no_pagefill -dMaxBitmap=2147483647 -dUseFastColor=true "test.ps" 2> "./psconvert_5456c.bb"] returned error 1.
I don’t get how gmt calls gs and what could be wrong with it, but I think this narrows it down quite a bit.
Also, I realized where gs points me in the right dir, but is not picking gswin64.exe or gswin64c.exe but rather a gs.exe, I don’t know if that could be causing the problem though
Hmm, I don’t know what Conda does when it installs Ghostscript.
When one installs Ghostscript via the official installer it adds the necessary info to find itself in the Windows registry. A well-not-known fact is that Windows have 2 registries. One for 32 and another for 64 bits and where it gets added depends if one uses the 32 or the 64 bits installer.
GMT searches the registry and if it finds the Ghost it will use it. Otherwise it uses the gswin64c.exe that is shipped with GMT. Somehow, something is interfering with this and the fact that you find a gs.exe in your system is … strange. Who installed it?
This version was installed through conda, I believe through conda-forge. But it might be the case that there’s some registry issue because of a previous ghostscript install. I will try to tinker with the ghostscript install to see if it changes something.
I checked the issue report and I’m both happy to say it’s the exact same one, and frustrated that I still can’t solve it. I didn’t really understand the workaround that’s mentioned either, as both gswin64 and gswin64c are in my %PATH%. So unless gmt is not checking the full path, or is checking the windows cmd path and not the conda env path, I wouldn’t know where to even move the executables.
If I’m not mistaken the story is that when gs is in the registry it expects that the location of gsdll64.dll is in the registry too. If that info points to no longer existing location, shit will follow.
Do you have an official ghost installed? I would say that it’s preferable than to have a Conda installed one.
And, if no ghost is installed at all the one that comes with GMT should work fine.
Both gs.exe and gsdll64.dll are in the same directory with everything else. I already tried installing ghostscript through the installer, through conda, I did it through pip before. Nothing worked. I’m a couple days away from formatting my pc just to get it to work. I have no idea what is wrong and I think I never will, sadly for the one who stumbles upon this after me.
I have 9.54.0, and the registry entries are GS_DLL and GS_LIB. The first one points to gsdll64.dll in the bin folder, while the second one points to the bin, lib and fonts folders in my environment. I don’t really know why gs.exe is there, but it runs the correct version of ghostscript and is installed by conda alongside the other ghostscript executables (maybe so you can run gs on cmd without having to type the full name?)
OK, so probably gs.exe is just a copy of gswin64c.exe (which I assume is one of the other ghostscript executables) and Conda wants it so that it can use the same name as in Linux.
Running out of ideas but as a final test try to move away (just rename them) the gswin64c.exe and the gsdll64.dll that you find in the GMT bin dir. If it still errors it has to be an ghostscript dependency shit. The other alternative is to remove all external ghosts and leave only the one shipped with GMT (which is what I do, as well as all people that install GMT and know nothing about the Ghostscript existence).
(pygmt) C:\Users\fedes>gmt basemap -R0/1/0/1 -JX1 -Baf -Vi -png map
begin [INFORMATION]: Creating a workflow directory C:/Users/fedes/.gmt/sessions/gmt_session.11568
basemap [INFORMATION]: Constructing the basemap
basemap [INFORMATION]: Auto-frame interval for x-axis (item 0): a0.2f0.1
basemap [INFORMATION]: Auto-frame interval for y-axis (item 0): a0.2f0.1
basemap [INFORMATION]: Map scale is 0.001 km per cm or 1:100.
end [INFORMATION]: Process GMT figure queue: 1 figures found
end [INFORMATION]: Processing GMT figure #0 [map png ]
psconvert [ERROR]: Registry registered C:\Users\fedes\anaconda3\envs\pygmt\Library\bin\gswin64c.exe does not exist. Resorting to the one provided in GMT.
El sistema no puede encontrar la ruta especificada.
psconvert [ERROR]: Cannot execute Ghostscript (gswin64c).
end [ERROR]: Failed to call psconvert
end [ERROR]: gmtinit_process_figures returned error 79
end [INFORMATION]: Destroying the current workflow directory C:/Users/fedes/.gmt/sessions/gmt_session.11568
basemap [ERROR]: Unable to call module end for a one-liner plot.
I tried to remove all external gs before, and couldn’t get it to work either. The only other thing that comes to mind is that I have Octave installed and (I think) it uses some sort of ghostscript utility, but I don’t really want to uninstall Octave though.
Hmm, we have new infos here. The El sistema no puede encontrar la ruta especificada. occurs when it tries to run the GMT shipped ghostscript, and it happens either when it’s there and when not !!!
Do you know what is the English equivalent error message? Can it be File not found instead of Path not found like the Spanish message is saying?
And regarding your other ghosts, I see that you have at least 3. Picking from previous messages I see
C:/Users/fedes/anaconda3/envs/cin2020/Library/bin/gswin64c.exe
(env1) C:\Users\fedes>where gswin64c
C:\Users\fedes\anaconda3\envs\env1\Library\bin\gswin64c.exe
psconvert [ERROR]: Registry registered C:\Users\fedes\anaconda3\envs\pygmt\Library\bin\gswin64c.exe does not exist.
And, where do you have GMT installed? Somedir with a space in the name?
The error message should be about the Path, I don’t think they would change the meaning that much when translating. However, maybe the path it is refering to leads all the way to the gs file, so it might be the same as file not found. I get that gmt shouldn’t be doing anything weird to call gs, and it should look for it in the registry or system path, but I can’t possibly think of another cause of this.
Regarding the many different versions of ghostscript, it’s because I kept erasing and making new environments in conda to try different things. I never had more than one environment at the same time. Sorry if changing that caused some confusion.
GMT is installed in the envname\Library\bin dir, there’s no space nowhere in the path’s name.
Yes, that’s the environment and path I’m currently using. That error was when I renamed gswin64c.exe as something else, but if I rename it back the error goes back to the original one
Ok, some misunderstanding. What I suggested was to rename the gswin64c.exe and gsdll64.dll that you have in GMT bin dir so that we could distinguish if the problem comes from the GMT shipped ghost or the in registry one(s)
Something else strange is going on. You say that GMT is installed in the envname\Library\bin so it was installed by Conda. But the Conda dll is called gmt.dll and you have gmt_w64.dll which is the name of the dll from the official GMT installer, which is not what Conda installs.
You are right, that path was from when I tried to do the install without conda, so I used the official installer. What I get displayed right now is this
I’m afraid this will never end. Do you have, or not, an official GMT (in c:\programs\gmt6)? It should work without any interference from the Conda one. If you have, does it work well?
Okay, I got it now. Tried it and it makes no difference, here’s the output
(pygmt) C:\Users\fedes>gmt basemap -R0/1/0/1 -JX1 -Baf -Vi -png map
begin [INFORMATION]: Creating a workflow directory C:/Users/fedes/.gmt/sessions/gmt_session.6420
basemap [INFORMATION]: Constructing the basemap
basemap [INFORMATION]: Auto-frame interval for x-axis (item 0): a0.2f0.1
basemap [INFORMATION]: Auto-frame interval for y-axis (item 0): a0.2f0.1
basemap [INFORMATION]: Map scale is 0.001 km per cm or 1:100.
end [INFORMATION]: Process GMT figure queue: 1 figures found
end [INFORMATION]: Processing GMT figure #0 [map png ]
El sistema no puede encontrar la ruta especificada.
psconvert [INFORMATION]: Processing C:/Users/fedes/.gmt/sessions/gmt_session.6420/gmt_0.ps-...
psconvert [INFORMATION]: Find HiResBoundingBox ...
El sistema no puede encontrar la ruta especificada.
psconvert [ERROR]: System call [@"C:\Program Files\gs\gs9.54.0\bin\gswin64c.exe" -q -dNOSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -DPSL_no_pagefill -dMaxBitmap=2147483647 -dUseFastColor=true "C:/Users/fedes/.gmt/sessions/gmt_session.6420/gmt_0.ps-" 2> "C:/Users/fedes/.gmt/sessions/gmt_session.6420/psconvert_9072c.bb"] returned error 1.
end [ERROR]: Failed to call psconvert
end [ERROR]: gmtinit_process_figures returned error 79
end [INFORMATION]: Destroying the current workflow directory C:/Users/fedes/.gmt/sessions/gmt_session.6420
basemap [ERROR]: Unable to call module end for a one-liner plot.