# Error choropleth() got an unexpected keyword argument 'geojson'

**URL:** <https://community.plotly.com/t/error-choropleth-got-an-unexpected-keyword-argument-geojson/34600>\
**Category:** 📊 Plotly Python\
**Created:** [February 6, 2020, 1:46pm UTC](https://community.plotly.com/t/error-choropleth-got-an-unexpected-keyword-argument-geojson/34600 "2020-02-06T13:46:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yo.angelina](https://avatars.discourse-cdn.com/v4/letter/y/cc9497/32.png) [@yo.angelina](https://community.plotly.com/u/yo.angelina)\
**Post date:** [February 6, 2020, 1:46pm UTC](https://community.plotly.com/t/error-choropleth-got-an-unexpected-keyword-argument-geojson/34600/1 "2020-02-06T13:46:21Z")

</div>

I am trying to use Plot.ly choropleth map vizualisation, but when I copy the example code (or when I customize it) I get the following error : TypeError: choropleth() got an unexpected keyword argument ‘geojson’

I am running this code

```auto
from urllib.request import urlopen
import json
with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:
    counties = json.load(response)

import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv",
                   dtype={"fips": str})

import plotly.express as px

fig = px.choropleth(df, geojson=counties, locations='fips', color='unemp',
                           color_continuous_scale="Viridis",
                           range_color=(0, 12),
                           scope="usa",
                           labels={'unemp':'unemployment rate'}
                          )
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()

```

Any ideas why?

---

<div class="post-metadata">

**Author:** ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)\
**Post date:** [February 6, 2020, 3:57pm UTC](https://community.plotly.com/t/error-choropleth-got-an-unexpected-keyword-argument-geojson/34600/2 "2020-02-06T15:57:36Z")

</div>

Hi @yo.angelina, welcome to the forum! The `geojson` attribute was introduced in the latest release of plotly.py (4.5), maybe you have an older version installed? You can check it with

```auto
import plotly
print(plotly. __version__ )

```

You can update your version of plotly by doing `pip install -U plotly` (or with conda if you’re using conda). More instructions are given in [https://plot.ly/python/getting-started/](https://plot.ly/python/getting-started/)

---

<div class="post-metadata">

**Author:** ![yo.angelina](https://avatars.discourse-cdn.com/v4/letter/y/cc9497/32.png) [@yo.angelina](https://community.plotly.com/u/yo.angelina)\
**Post date:** [February 6, 2020, 5:48pm UTC](https://community.plotly.com/t/error-choropleth-got-an-unexpected-keyword-argument-geojson/34600/3 "2020-02-06T17:48:11Z")

</div>

Hi @Emmanuelle, thanks!

Indeed, it was version problem (I had 4.4.1 installed). Everything works now 🙂
