Base.IOError

I keep getting the below error when I use my GMT.jl.
Base.IOError("could not spawn gmt --version: no such file or directory (ENOENT)", -2)

Funny thing is that it does not affect the results. I can still get the map I need.

Should I just ignore this error message, or is there a fix?

Hmm, it doesn’t smell good. What do you mean by “every time I use”? When you do using GMT?
What happens if you run

run(`gmt --version`)
1 Like

Thanks for the reply!

There are no errors when I ran using GMT, but run(gmt --version) caused the below errors:

**julia>** using GMT

**julia>** run(`gmt --version`)

**ERROR:** IOError: could not spawn `gmt --version`: no such file or directory (ENOENT)

Stacktrace:
[1] **_spawn_primitive(**file::String, cmd::Cmd, stdio::Vector{Any}**)**
@ Base ./process.jl:100
[2] **#690**
@ ./process.jl:113 [inlined]
[3] **setup_stdios(**f::Base.var"#690#691"{Cmd}, stdios::Vector{Any}**)**
@ Base ./process.jl:197
[4] **_spawn**
@ ./process.jl:112 [inlined]
[5] **run(**::Cmd; wait::Bool**)**
@ Base ./process.jl:445
[6] **run(**::Cmd**)**
@ Base ./process.jl:444
[7] top-level scope
@ REPL[5]:1
**julia>**

Here is some background info about my version of GMT:

  • I was on my Mac OS Big Sur when this happened.
  • I installed GMT.jl by first installing ghostscript and then ] add GMT.
  • As I mentioned, other than this, it runs fine.

Could this be due to the fact that I did not set up my ~/zshrc file?

In Linux, I added the below to my zshrc file, but for my Mac OS version, I have no idea where my GMT was setup.
export PATH="/usr/local/bin/:$PATH"

Not sure what I did, I just test ran my jl file again and no longer see this error anymore.

Like the error message says, the error occurs when the gmt executable is not found. And it’s not found when it’s not in the path. Unless it was automatically installed by Conda and then GMT.jl knows where it is.

GMT.GMT_bindir tells you where the gmt executable lives.

1 Like

Many thanks!

It seems my version was installed by conda. Below is the path when I run GMT.GMT_bindir:

/Users/name/.julia/conda/3/bin