Cannot import gdal in jupyter notebook

MRAB python at mrabarnett.plus.com
Tue Oct 11 16:26:02 EDT 2022


On 2022-10-11 20:38, Thomas Passin wrote:
> On Windows, when I tried to install gdal using pip, it needed to compile
> part of it.  I'm not set up with the Microsoft compiler and header
> files, so that failed.  If you are on Windows, you will need to look for
> a binary wheel to install, or install and configure the compiler and
> header files.
> 
The PyPI page at https://pypi.org/project/GDAL/ has this:

"""
Conda
GDAL can be quite complex to build and install, particularly on Windows 
and MacOS. Pre built binaries are provided for the conda system:

https://docs.conda.io/en/latest/

By the conda-forge project:

https://conda-forge.org/
"""

> On 10/11/2022 11:53 AM, Abdul Haseeb Azizi wrote:
>> Hi everyone,
>> I am new to python and I am trying to utilize this code "from osgeo import gdal". I installed python 3.10 and also I installed anaconda3 to solve this matter but I could not succeed. When I run that code I get the following error.
>> ---------------------------------------------------------------------------
>> ModuleNotFoundError                       Traceback (most recent call last)
>> Cell In [1], line 1
>> ----> 1 from osgeo import gdal
>> 
>> ModuleNotFoundError: No module named 'osgeo'
>> 
>> I also tried to create anaconda environment and enter the following codes:
>> conda crate --name pygdal
>> conda activate pygdal
>> conda install -c conda-forge gdal
>> 
>> I don't what is the problem. Any help is appreciated to solve this matter.
>> Looking forward to hear from you.
>> 
>> with regards
>> Abdul
> 



More information about the Python-list mailing list