Skip to content

Google Colab Implementation #50

Closed
Closed

Description

@sarahshi

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

Activity

  1. seisman commented on Jun 30, 2023

    @seisman
    Member
  2. seisman commented on Jun 30, 2023

    @seisman
    Member

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

    !pip install -q condacolab
    import condacolab
    condacolab.install()
    
  3. seisman commented on Jun 30, 2023

    @seisman
    Member

    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.

  4. weiji14 commented on Jun 30, 2023

    @weiji14
    Member

    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?

  5. seisman commented on Sep 2, 2023

    @seisman
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions