I am trying to use a specific package called rasterio
in python which I have been unable to use. What I am specifically confused about is the disconnect I am seeing between Windows Command Prompt, Anaconda Prompt, and Jupyter Notebook, the platform I use for python.
I open Jupyter Notebook and run import rasterio
and get an error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-17-350e27267e59> in <module>
----> 1 import rasterio
~\Anaconda3\lib\site-packages\rasterio\__init__.py in <module>
15 from pathlib import Path
16
---> 17 from rasterio._base import gdal_version
18 from rasterio.drivers import driver_from_extension, is_blacklisted
19 from rasterio.dtypes import (
ImportError: DLL load failed: The specified module could not be found.
I then try to run in Anaconda Prompt (Anaconda3) after running python: and get basically the same error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\MyName\Anaconda3\lib\site-packages\rasterio\__init__.py", line 17, in <module>
from rasterio._base import gdal_version
ImportError: DLL load failed: The specified module could not be found.
But then I try with Windows Command Prompt, running python and then import rasterio, and the package imports successfully.
And then I notice that running python
on Anaconda Prompt shows:
Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
And running python_version()
in Jupyter Notebook produces:
'3.7.4'
And then I see running python
in Windows Command Prompt shows:
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
And so it seems like python in Windows Command Prompt is just in a totally different space than what is being run on Jupyter Notebook and Anaconda Prompt. For some reason rasterio
installed successfully with Python 3.9.5 but not with Python 3.7.4. And so while I have been struggling to get rasterio to install correctly, it looks like I already have installed it successfully. But my question is how can I get Jupyter Notebook to "talk" to my python version from Command Prompt so that it "understands" I already installed this package? I simply just want to use this package in Jupyter Notebook, but it just seems like Jupyter Notebook does not understand that it is already installed.