Closed jasonhappyforver closed 1 month ago
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.
gs path
(pygmt_home) C:\Users\MJDR5>where gs
C:\Users\MJDR5\AppData\Local\anaconda3\envs\pygmt_home\Library\bin\gs.exe
do you have gswin64c.exe or gswin32c.exe in this directory.
Please also post the output of the following script:
import pygmt
fig = pygmt.Figure()
fig.basemap(region=[0, 1, 0, 1], projection="X5c", frame="af")
pygmt.config(GMT_VERBOSE="d")
fig.show()
Please also post the output of the following script:
import pygmt fig = pygmt.Figure() fig.basemap(region=[0, 1, 0, 1], projection="X5c", frame="af") pygmt.config(GMT_VERBOSE="d") fig.show()
gs path
(pygmt_home) C:\Users\MJDR5>where gs
C:\Users\MJDR5\AppData\Local\anaconda3\envs\pygmt_home\Library\bin\gs.exedo you have gswin64c.exe or gswin32c.exe in this directory.
Thank you for your handling. I do have gswin64c.exe.
(pygmt_home) C:\Users\MJDR5>where gswin64c.exe
C:\Users\MJDR5\AppData\Local\anaconda3\envs\pygmt_home\Library\bin\gswin64c.exe
Please also post the output of the following script:
import pygmt fig = pygmt.Figure() fig.basemap(region=[0, 1, 0, 1], projection="X5c", frame="af") pygmt.config(GMT_VERBOSE="d") fig.show()
gs path
(pygmt_home) C:\Users\MJDR5>where gs
C:\Users\MJDR5\AppData\Local\anaconda3\envs\pygmt_home\Library\bin\gs.exedo you have gswin64c.exe or gswin32c.exe in this directory.
Thank you for your handling. I do have gswin64c.exe:
(pygmt_home) C:\Users\MJDR5>where gswin64c.exe
C:\Users\MJDR5\AppData\Local\anaconda3\envs\pygmt_home\Library\bin\gswin64c.exe
Following your suggestion, I ran the script,
import pygmt
fig = pygmt.Figure()
fig.basemap(region=[0, 1, 0, 1], projection="X5c", frame="af")
pygmt.config(GMT_VERBOSE="d")
fig.show()
Output:
gmtset [DEBUG]: gmtlib_get_graphics_item: Fig: 1 Subplot: 2 Panel: () Inset: 0
pygmt-session [DEBUG]: Exit: gmt_reload_settings
pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
pygmt-session [DEBUG]: Exit: gmtlib_plot_C_format
pygmt-session [DEBUG]: Enter: gmtinit_get_history
pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 1 Subplot: 2 Panel: () Inset: 0
pygmt-session [DEBUG]: Enter: gmt_hash_init
pygmt-session [DEBUG]: Exit: gmt_hash_init
pygmt-session [DEBUG]: Failed to release lock (Error <158>: The segment is already unlocked.
)
pygmt-session [DEBUG]: Exit: gmtinit_get_history
pygmt-session [DEBUG]: Initialize FFTW with 12 threads.
pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
pygmt-session [DEBUG]: Shared Library # 0 (core). Path = C:/Users/MJDR5/AppData/Local/anaconda3/envs/pygmt_home/Library/bin/gmt.dll
pygmt-session [DEBUG]: Loading GMT plugins from: C:/Users/MJDR5/AppData/Local/anaconda3/envs/pygmt_home/Library/bin/gmt_plugins
pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = C:/Users/MJDR5/AppData/Local/anaconda3/envs/pygmt_home/Library/bin/gmt_plugins/supplements.dll
pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = e0ec776f5a0345c4ae07d1a702793d45]
Exception ignored on calling ctypes callback function: <function Session.create.
Output over
Noting that:
What's the output if you run gswin64c --version
or gswin64c.exe --version
?
What's the output if you run
gswin64c --version
orgswin64c.exe --version
?
It is 10.03.1, please see below:
(pygmt_home) C:\Users\MJDR5>gswin64c --version
10.03.1
(pygmt_home) C:\Users\MJDR5>gswin64c.exe --version
10.03.1
This one is really hard to debug since we can't reproduce your issue.
Does fig.show(gs_path="C:\Users\MJDR5\AppData\Local\anaconda3\envs\pygmt_home\Library\bin\gswin64c")
works?
This one is really hard to debug since we can't reproduce your issue.
Does
fig.show(gs_path="C:\Users\MJDR5\AppData\Local\anaconda3\envs\pygmt_home\Library\bin\gswin64c")
works?
Yes, it worked, both fig.show and fig.save. It seems I need to specify the path in both commands. Thank you so very much.
Good to know that it works. Closing.
Description of the problem
I have recently started a new job at a different university. Thus I need to re-install some python packages, including pygmt, on my new laptop. However, I got some errors when I tried to run my previous code. The error pops up upon calling
fig.show()
, please see the following example and the corresponding full error message. I am aware that this error has been discussed before. After going through the previous threads on this topic, I still cannot figure it out. I appreciate it if you could help me out.I created an environment "pygmt_home" on my 64-bit windows laptop to demonstrate the issue. Some basic information:
gs version
(pygmt_home) C:\Users\MJDR5>gs -version
GPL Ghostscript 10.03.1 (2024-05-02) Copyright (C) 2024 Artifex Software, Inc. All rights reserved.gs path
(pygmt_home) C:\Users\MJDR5>where gs
C:\Users\MJDR5\AppData\Local\anaconda3\envs\pygmt_home\Library\bin\gs.exeGMT version
(pygmt_home) C:\Users\MJDR5>gmt -version
GMT - The Generic Mapping Tools, Version 6.5.0 [64-bit] [MP] [12 cores] (c) 1991-2024 The GMT Team (https://www.generic-mapping-tools.org/team.html)..... omit following lines
GMT path
(pygmt_home) C:\Users\MJDR5>where gmt
C:\Users\MJDR5\AppData\Local\anaconda3\envs\pygmt_home\Library\bin\gmt.exeSome Test
(pygmt_home) C:\Users\MJDR5>gmt basemap -R0/1/0/1 -JX1 -Baf -Vi -png map
begin [INFORMATION]: Creating a workflow directory C:/Users/MJDR5/.gmt/sessions/gmt_session.14116 basemap [INFORMATION]: Constructing the basemap basemap [INFORMATION]: Linear projection implies y-axis distance exaggeration relative to the x-axis by a factor of 1 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 [INFORMATION]: Processing C:/Users/MJDR5/.gmt/sessions/gmt_session.14116/gmt_0.ps-... psconvert [INFORMATION]: Find HiResBoundingBox ... psconvert [INFORMATION]: Figure dimensions: Width: 49.464 points [1.74498 cm] Height: 42.426 points [1.49669 cm] psconvert [INFORMATION]: [2863.91 2868.71 2913.37 2911.14]... psconvert [INFORMATION]: An unknown psconvert setting was found but since image coordinates seem to be geographical, a linear transformation will be used. psconvert [INFORMATION]: Convert to PNG... end [INFORMATION]: Destroying the current workflow directory C:/Users/MJDR5/.gmt/sessions/gmt_session.14116Minimal Complete Verifiable Example
Full error message
System information