I get more or less the same error, with VSCode Version: 1.102.3 on Ubuntu 24.04.2 LTS. With my local python env, I can import rasterio in .py files, in command line, but not in .ipynb.