Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Colab Implementation #50

Closed
sarahshi opened this issue Jun 29, 2023 · 5 comments
Closed

Google Colab Implementation #50

sarahshi opened this issue Jun 29, 2023 · 5 comments

Comments

@sarahshi
Copy link

Hi,

Hope this message finds you well. I developed a teaching module using PyGMT back in February using Google Colab. I used this described solution to import PyGMT and things worked well. It sometimes took running the import cell another time -- some folks got an error upon first run -- but things worked successfully

I am currently preparing to teach this module again and just tried running through the code again. I am now getting the error appended. Do you know what may be causing this error? I didn't find any solutions on the forum and figured I may raise the issue here. Thanks in advance for any guidance.

Best,
Sarah

---------------------------------------------------------------------------
GMTCLibNotFoundError                      Traceback (most recent call last)
[<ipython-input-2-9b6890099622>](https://localhost:8080/#) in <cell line: 8>()
      6 condacolab.install()
      7 get_ipython().system('mamba install pygmt')
----> 8 import pygmt
      9 from matplotlib import pyplot as plt
     10 get_ipython().run_line_magic('matplotlib', 'inline')

4 frames
[/usr/local/lib/python3.10/site-packages/pygmt/clib/loading.py](https://localhost:8080/#) in load_libgmt(lib_fullnames)
     57 
     58     if error:
---> 59         raise GMTCLibNotFoundError("\n".join(error_msg))
     60 
     61     return libgmt

GMTCLibNotFoundError: Error loading GMT shared library at '/usr/local/lib/libgmt.so'.
/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/local/lib/./libgdal.so.32)
Error loading GMT shared library at 'libgmt.so'.
libgmt.so: cannot open shared object file: No such file or directory
@seisman
Copy link
Member

seisman commented Jun 30, 2023

I just tried the PyGMT demo (https://colab.research.google.com/github/GenericMappingTools/try-gmt/blob/master/python-demo.ipynb) and it works well for me. So it means the solution still works.

@seisman
Copy link
Member

seisman commented Jun 30, 2023

Maybe you have to run the install commands in a separate cell?

!pip install -q condacolab
import condacolab
condacolab.install()

@seisman
Copy link
Member

seisman commented Jun 30, 2023

Maybe you have to run the install commands in a separate cell?

!pip install -q condacolab
import condacolab
condacolab.install()

Running the above commands in a separate cell works well for me.

@weiji14
Copy link
Member

weiji14 commented Jun 30, 2023

That error looks similar to #37 (comment), and I think is due to out of sync dependencies on conda-forge. Maybe the recent PRs like conda-forge/gmt-feedstock#260 fixed it already?

@seisman
Copy link
Member

seisman commented Sep 2, 2023

Closing the issue as Google Colab works well for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants