AgriFieldNet India Challenge
Can you detect crop types in a class-imbalanced satellite image dataset?
$10 000 USD
Ended 26 days ago
179 active · 626 enrolled
Rasterio Error
Notebooks · 26 Sep 2022, 03:20 · 2

We have been having issues with importing the packages onto the notebook. The following statement "AttributeError: partially initialized module 'rasterio' has no attribute '_loading' (most likely due to a circular import)" is produced when prompted import rasterio. Please help!!!! the issue repeats even after installing in conda terminal and CMD terminal.

Discussion 2 answers

I am having the exact same challenge and I am still trying to resolve it on my local machine. I searched stack overflow and the summary of the responses I'm getting is that there is a file that shares a name with the source file for the rasterio library and this causes a naming conflict in the directory where the installed rasterio files are stored. When you attempt to import it, python can't tell which file you want to import between raterio and the conflicting system file, hence the error. Rasterio successfully installs via pip and conda though, so it is not a problem with the installation, but a problem with the importation of the library.

While I am still trying to sort the issue out, I found that the import cells run smoothly on google colab, so that's what I am using for now. Remember to !pip install rasterio and !pip install radiant_mlhub on colab before you run your imports. If you find a way to access the .py directory and rename the conflicting file in the rasterio library, this will allow you to run rasterio successfully on your local machine, Please be sure to post the working solution if you succeed as it will be helpful to the rest of us. I hope this helps.

I tried downloading GDAL & rasterio binary files from the link provided in documentation and installed. It worked for me.

Python version - 3.8.10

pip install GDAL-3.4.3-cp38-cp38-win_amd64.whl

pip install rasterio-1.2.10-cp38-cp38-win_amd64.whl