How do you install PyGMT on Google Colab notebook.
Try running following commands in Google Colab:
!wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh !chmod +x Miniconda3-latest-Linux-x86_64.sh !bash ./Miniconda3-latest-Linux-x86_64.sh -bfp /usr/local !conda update conda -y -q !conda config --prepend channels conda-forge !conda install -q -y --prefix /usr/local python=3.8 pygmt import sys import os sys.path.append('/usr/local/lib/python3.8/site-packages') os.environ["GMT_LIBRARY_PATH"]="/usr/local/lib"
Then you should be able to use pygmt:
@seisman Worked well for me, thanks!
Do we have to install pygmt everytime we access Colab? Because after completing my work and come back couple of days later, I have to run your codes again.
Best regards from Istanbul.
Yes, I believe so. Google colab doesn’t save your environment.
Yeah, that was my belief, too. Pity.
I can reproduce your issue. Loading the libgmt.so gives me the following message:
OSError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/local/lib/././libtiledb.so.2.1)
I think some other conda-forge packages are broken.
Did this ever get resolved, or is there an issue for this?
I’m not sure. The PyGMT tests all work well, but the try-gmt binder seems broken recently (GMT.jl is broken on Binder · Issue #15 · GenericMappingTools/try-gmt (github.com)).
I have the same issue