-
Notifications
You must be signed in to change notification settings - Fork 12
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
Uploaded a working version of pygmt on colab #37
Conversation
This version is 100% functional in colab with PyGMT version v0.5.0, Python 3.7.13 (default, Apr 24 2022) and GMT lib version 6.5.0.
This version is 100% functional in colab with PyGMT version v0.5.0, Python 3.7.13 (default, Apr 24 2022) and GMT lib version 6.5.0.
As I understand it, Google Colab only provides Python 3.7, but PyGMT requires Python>=3.8 since v0.6.0. Do you know any way to install newer Python versions in Google Colab? I've tried many times but failed. |
Every time I tried to change Python version, some problem happened. However, installing GMT as I did, and then Maybe we should write a "Warning" that even though PyGMT requires Python>=3.8, it works fine with 3.7 as long as it doesn't conflict with some internal requirement. As far as I could test with simple things (maps, figures, XY, etc) it works perfectly and without restrictions. |
Related issues at googlecolab/colabtools#1422 and googlecolab/colabtools#2165. No timeline as to when Google Colab will use Python 3.8+ though :/ Did any of you manage to try the solutions at https://stackoverflow.com/questions/60775160/install-python-3-8-kernel-in-google-colaboratory? |
Hello @weiji14 But again - GMT/PyGMT over Python 3.7 COLAB works perfectly with the recipe I gave. Maybe, instead of trying to go through this Branch that requires Python 3.8, we can create a parallel one for anyone who wants to use PyGMT via COLAB. I don't know how many people fit into this, but for example, in my classes it's much more practical for students to use COLAB in the teaching lab. |
trying to understand what in the validator was wrong. I believe it is not patch related. |
Looks like Google Colab finally updated to Python 3.8 in googlecolab/colabtools#3246 🎉 Shall we revive this Pull Request? |
I tried running this code block: !wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
!chmod +x Mambaforge-Linux-x86_64.sh
!bash ./Mambaforge-Linux-x86_64.sh -bfp /usr/local
!mamba 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" But am getting an error like so on GMTCLibNotFoundError: Error loading GMT shared library at '/usr/local/lib/libgmt.so'.
/usr/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 I had a look at https://stackoverflow.com/questions/23244418/set-ld-library-path-before-importing-in-python which suggested setting |
I know this one. GCC12 broke compatibility of |
Superseded by #45. |
This version is 100% functional in colab with PyGMT version v0.5.0, Python 3.7.13 (default, Apr 24 2022) and GMT lib version 6.5.0.