# Unable to install wradlib in linux

**URL:** <https://openradar.discourse.group/t/unable-to-install-wradlib-in-linux/65>\
**Category:** Openradar\
**Tags:** wradlib\
**Created:** [October 19, 2022, 12:08pm UTC](https://openradar.discourse.group/t/unable-to-install-wradlib-in-linux/65 "2022-10-19T12:08:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muru](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Muru](https://openradar.discourse.group/u/Muru)\
**Post date:** [October 19, 2022, 12:08pm UTC](https://openradar.discourse.group/t/unable-to-install-wradlib-in-linux/65/1 "2022-10-19T12:08:24Z")

</div>

HI,  
I am unable to install wradlib in linux. It fails with below error.

I am using Python 3.6.8  
and pip install wradlib

Any help would be appreciated.

Collecting GDAL  
Using cached GDAL-3.5.2.tar.gz (756 kB)  
Preparing metadata (setup.py) … error  
ERROR: Command errored out with exit status 1:  
command: /var/data/tef-radolan-files-download/py\_environment/bin/python3 -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-qtr1fvpn/gdal\_  
3ae86bab99974b4e9b552b72362e69c0/setup.py’“'”‘; **file** =’“'”‘/tmp/pip-install-qtr1fvpn/gdal\_3ae86bab99974b4e9b552b72362e69c0/setup.py’“'”‘;f = getattr(tokenize, ‘"’"‘open’  
"’“‘, open)( **file** ) if os.path.exists( **file** ) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.  
close();exec(compile(code, **file** , ‘"’“‘exec’”’"‘))’ egg\_info --egg-base /tmp/pip-pip-egg-info-w6aerc2d  
cwd: /tmp/pip-install-qtr1fvpn/gdal\_3ae86bab99974b4e9b552b72362e69c0/  
Complete output (118 lines):  
running egg\_info  
creating /tmp/pip-pip-egg-info-w6aerc2d/GDAL.egg-info  
writing /tmp/pip-pip-egg-info-w6aerc2d/GDAL.egg-info/PKG-INFO  
writing dependency\_links to /tmp/pip-pip-egg-info-w6aerc2d/GDAL.egg-info/dependency\_links.txt  
writing requirements to /tmp/pip-pip-egg-info-w6aerc2d/GDAL.egg-info/requires.txt  
writing top-level names to /tmp/pip-pip-egg-info-w6aerc2d/GDAL.egg-info/top\_level.txt  
writing manifest file ‘/tmp/pip-pip-egg-info-w6aerc2d/GDAL.egg-info/SOURCES.txt’  
Traceback (most recent call last):  
File “/tmp/pip-install-qtr1fvpn/gdal\_3ae86bab99974b4e9b552b72362e69c0/setup.py”, line 105, in fetch\_config  
p = subprocess.Popen([command, args], stdout=subprocess.PIPE)  
File “/usr/lib64/python3.6/subprocess.py”, line 729, in **init**  
restore\_signals, start\_new\_session)  
File “/usr/lib64/python3.6/subprocess.py”, line 1364, in \_execute\_child  
raise child\_exception\_type(errno\_num, err\_msg, err\_filename)  
FileNotFoundError: [Errno 2] No such file or directory: ‘…/…/apps/gdal-config’: ‘…/…/apps/gdal-config’

---

<div class="post-metadata">

**Author:** ![kmuehlbauer](https://yyz2.discourse-cdn.com/free1/user_avatar/openradar.discourse.group/kmuehlbauer/32/439_2.png) [@kmuehlbauer](https://openradar.discourse.group/u/kmuehlbauer)\
**Post date:** [October 20, 2022, 4:57am UTC](https://openradar.discourse.group/t/unable-to-install-wradlib-in-linux/65/2 "2022-10-20T04:57:04Z")

</div>

Hi Muru,

Installing with pip can get hard, as not all dependencies have wheels for all systems available. And even that doesn’t prevent you from getting into dependency hell (eg. library version mismatch).

Please see the [wradlib docs](https://docs.wradlib.org/en/stable/installation.html#installing-via-pip) for more information.

I would recommend to use conda to create Python environments to get out of the way of these dependency issues.

---

<div class="post-metadata">

**Author:** ![Muru](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Muru](https://openradar.discourse.group/u/Muru)\
**Post date:** [October 20, 2022, 8:54am UTC](https://openradar.discourse.group/t/unable-to-install-wradlib-in-linux/65/3 "2022-10-20T08:54:19Z")

</div>

Hi Kai,  
Thank you. Yes, You are right. With pip making it hard to install. I will use conda.

---

<div class="post-metadata">

**Author:** ![d-siden](https://yyz2.discourse-cdn.com/free1/user_avatar/openradar.discourse.group/d-siden/32/95_2.png) [@d-siden](https://openradar.discourse.group/u/d-siden)\
**Post date:** [February 5, 2023, 4:20pm UTC](https://openradar.discourse.group/t/unable-to-install-wradlib-in-linux/65/4 "2023-02-05T16:20:14Z")

</div>

I’ve managed to install wradlib in a virtual environment using Pycharm Community IDE.

The real issue was installing GDAL.

My procedure was this:

1. This was done using a python 3.9 interpreter, it was installed this way from deadsnakes PPA:

```auto
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt install python3.9
$ python3.9 --version
$ sudo apt-get install python3.9-distutils
$ sudo apt-get install python3.9-dev

```

**Then I setup and activate my virtual environment using Python 3.9 as my interpreter. Assuming this is done, the next step was done on Pycharm’s terminal window:**

1. GDAL installation from ubuntugis PPA:

```auto
$ #!/usr/bin/env bash
$ sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update
$ sudo apt-get update
$ sudo apt-get install gdal-bin
$ sudo apt-get install libgdal-dev
$ export CPLUS_INCLUDE_PATH=/usr/include/gdal
$ export C_INCLUDE_PATH=/usr/include/gdal

```

1. After the last command, check which version of GDAL you have.

```auto
$ gdal-config --version
A.B.C

```

Where `A.B.C` are three numbers.

1. Use pip to install your corresponding GDAL version:

```auto
$ pip install GDAL==A.B.C

```

**This should work, however:**

- If pip claims to be trying a different version like:

```auto
Using cached GDAL-D.E.F.tar.gz

```

Where `D.E.F` differs from `A.B.C` at any point.  
Purge pip’s cache:

```auto
$ pip cache purge

```

- Retry step 4.

This worked for me in two different computers using the same Ubuntu version (20.04).

Trivia: I did install the recommended packages manually and checked the version, all before using `wradlib`.  
I do import the recommended packages before loading `wradlib`:

```auto
"""the # is the minimum recommended version (see wradlib docs)"""
> import os
> import numpy #1.21.0
> import scipy #1.7.0
> import matplotlib #3.3.0
> import xarray #0.20.2
> from osgeo import gdal #3.1.0
> import wradlib

```
