BJPrim
BJPrim

Reputation: 358

installing gdal in pycharm

I have been trying to import "gdal" in PyCharm for a couple of hours now, but without success and I do not know any further now.

In the Anaconda Powershell I installed gdal:

conda install gdal,

and that seemed to work, I get "# All requested packages already installed". Also, when I hit conda list, gdal is listed as one of the packages (gdal 2.3.3).

Now, normally it works in PyCharm then. However, this time it does not. What I tried:

Any ideas? Thank you!

Upvotes: 1

Views: 3509

Answers (1)

Kapil Grv
Kapil Grv

Reputation: 21

The best way to use conda anywhere would be to install a conda environment with the following commands followed by using the same environment in the pycharm.

Conda environment install commands:

conda create -n gdal python=3.7
activate gdal
conda install -c conda-forge gdal

Setting conda environment in the pycharm:

-> Go to Preferences / settings in pycharm 
-> Search for `python interpreter` 
-> Click on the drop down and then click on show all
-> Click on the + symbol to add the environment
-> Click on Conda environment in the left panel and select existing environment
-> Select the exact path of python3.7 (or other version) where the environment is installed (/opt/anaconda3/envs/gis/bin/python3.7 - in case of mac)

That should get the job done.

Upvotes: 1

Related Questions