1

I use the following commands from https://lerryws.xyz/posts/qgis-in-google-colab and get "No module named 'PyQt5.QtCore'" error:

!sudo apt-get install gnupg software-properties-common
!sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D155B8E6A419C5BE
!sudo add-apt-repository "deb https://qgis.org/debian-ltr/ `lsb_release -c -s` main"
!sudo apt-get update
!sudo apt-get install opencl-headers ocl-icd-opencl-dev
!sudo apt-get install qgis qgis-plugin-grass
!export PYTHONPATH="/usr/share/qgis/python"
!export LD_LIBRARY_PATH="/usr/lib/qgis"
!export QGIS_PREFIX="/usr"

import os
from osgeo import ogr
from qgis.core import *
from qgis.analysis import *

I think the problem will be solved if I install PyQt5. So, I use this command:

!pip install PyQt5

Then, I run these commands again:

import os
from osgeo import ogr
from qgis.core import *
from qgis.analysis import *

However, I get "No module named 'qgis._core'" error instead. I have no idea what to do next to solve this problem. Do you have any idea how to properly setup QGIS on Google Colab?

Chrono R.
  • 11
  • 1

0 Answers0