BenjiBoy
BenjiBoy

Reputation: 305

Use pygmt in a IDE (spyder) with conda

I'm using spyder to make my codes. I try to use pygmt lib but, in my spyder-env I have an error :

GMTCLibNotFoundError: Error loading GMT shared library at 'libgmt.so'.
libgmt.so: cannot open shared object file: No such file or directory

According to the pygmt documentation, I have to create a new env to use this lib, so I did :

conda create --name pygmt --channel conda-forge pygmt

conda activate pygmt

But I have 2 problems :

  1. spyder launch itself with the 3 version instead of 5 (as in my spyder-env/ typically).

  2. Error stays :

    GMTCLibNotFoundError: Error loading GMT shared library at '/home/vialb/miniconda3/envs/pygmt/lib/libgmt.so'. /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/vialb/miniconda3/envs/pygmt/lib/./libgdal.so.31) Error loading GMT shared library at 'libgmt.so'. libgmt.so: cannot open shared object file: No such file or directory

I'm not familiar with environment so, I don't know what tot do with this...

Any idea ?

Upvotes: 0

Views: 994

Answers (1)

BenjiBoy
BenjiBoy

Reputation: 305

Hum, not sure if I done something different, but that's working now, with this procedure :

  1. on the (base) environnement, create pygmt env with :

    conda create --name pygmt --channel conda-forge pygmt

  2. activate the new env :

    conda activate pygmt

  3. install spyder

    conda install spyder

And ... That's all. Spyder open in version 5 and import pygmt works too.

Upvotes: 2

Related Questions