Comments (7)
I managed to use pygmt in the colab "installing GMT6 fresh".
Take a look at https://github.com/andrebelem/pythonverse/blob/main/PyGMT_on_COLAB.ipynb and feel free to incorporate it in the try-gmt.
from try-gmt.
I also noticed it yesterday. It's weird that the commands in the notebook install "python 3.9" but the python version in the error message says it's python3.6.
from try-gmt.
Two years ago, I created an example of how to use PyGMT in COLAB. I've updated the example now in the latest version of COLAB (March 2024), which you can see here: https://github.com/andrebelem/pythonverse/blob/main/Using_pygmt_in_COLAB_[version_2023].ipynb.
Essentially, you'll install Conda, and then GMT/PyGMT. Note that this should be done in parts, and the first two cells take about 3 minutes to install everything. Good luck.
from try-gmt.
I also noticed it yesterday. It's weird that the commands in the notebook install "python 3.9" but the python version in the error message says it's python3.6.
After doing some reading (e.g. https://towardsdatascience.com/conda-google-colab-75f7c867a522), it seems that we need to pin conda's Python version to be the same as that on Google Collaboratory (currently Python 3.7) instead of the Miniconda default (Python 3.9). However, I tried getting a Python 3.7 installer from https://repo.anaconda.com/miniconda/, and it still produces a DistributionNotFound error (as Liam and a forum user at https://forum.generic-mapping-tools.org/t/installing-pygmt-on-google-colab/898/12 reported). So needs a bit more work somehow.
from try-gmt.
Try to reinstall GMT and ghost script and refer to the libgmt.so.6
!sudo apt-get update
!sudo apt-get install gmt gmt-dcw gmt-gshhg
!sudo apt-get install -y ghostscript
!pip install pygmt
import os
!ln -s /lib/x86_64-linux-gnu/libgmt.so.6 /lib/x86_64-linux-gnu/libgmt.so
os.environ['LD_LIBRARY_PATH'] = ' /lib/x86_64-linux-gnu/libgmt.so'
Should work with these commands
from try-gmt.
PyGMT can't recognize to the libgmt.so under Google Colab. So, it is important to refer the path of libgmt.so in linux system which google are using
!ln -s /lib/x86_64-linux-gnu/libgmt.so.6 /lib/x86_64-linux-gnu/libgmt.so
What I did just adding alias of libgmt.so.6 and I reinstalled the GMT and ghost script.
It works well. I didn't try to use conda but good to know 2 ways of solving the problem
Thanks
from try-gmt.
Installing GMT using !sudo apt-get install gmt gmt-dcw gmt-gshhg
takes much longer than using conda/mamba, which causes most users to give up on the process. I myself abandoned the idea of apt install
some time ago. I recommend using conda install.
from try-gmt.
Related Issues (12)
- Need feedbacks on the Jupyter lab for trying GMT and its wrappers online HOT 11
- Julia version is still 1.3.1
- GMT.jl is broken on Binder HOT 6
- Binder repository for interactive GMT tutorials HOT 4
- Install optional geopandas dependency on try-gmt?
- Don't change links that the user is about to click HOT 2
- Add run GMT in bash instructions HOT 4
- Google Colab Implementation HOT 5
- New example to try pygmt on google colab. HOT 3
- The Julia example doesn't work HOT 2
- Improve the speed for loading the GMT.jl package HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from try-gmt.