# \[RLlib\] Error! TypeError: create\_policy\_mapping\_fn.\<locals\>.mapping\_fn() got an unexpected keyword argument 'worker'

**URL:** <https://discuss.ray.io/t/rllib-error-typeerror-create-policy-mapping-fn-locals-mapping-fn-got-an-unexpected-keyword-argument-worker/11117>\
**Category:** RLlib\
**Created:** [June 21, 2023, 8:30am UTC](https://discuss.ray.io/t/rllib-error-typeerror-create-policy-mapping-fn-locals-mapping-fn-got-an-unexpected-keyword-argument-worker/11117 "2023-06-21T08:30:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankithaldar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ankithaldar/32/4623_2.png) [@ankithaldar](https://discuss.ray.io/u/ankithaldar)\
**Post date:** [June 21, 2023, 8:30am UTC](https://discuss.ray.io/t/rllib-error-typeerror-create-policy-mapping-fn-locals-mapping-fn-got-an-unexpected-keyword-argument-worker/11117/1 "2023-06-21T08:30:21Z")

</div>

I have been trying to move my code from old ray RLlib version to 2.5.0 (latest).

You can find the old code @ [GitHub - ankithaldar/all\_python\_projects at world\_of\_supply/main](https://github.com/ankithaldar/all_python_projects/tree/world_of_supply/main)

I have made significant changes to the old code to move it to new version which can be found in branch

```auto
world_of_supply/fix_errors

```

in the same repo.

* * *

Below error is in the new version of the code in branch

```auto
world_of_supply/fix_errors

```

I’m getting an error as

```auto
TypeError: create_policy_mapping_fn.<locals>.mapping_fn() got an unexpected keyword argument 'worker'

```

when I try to train my PPO in the [file](https://github.com/ankithaldar/all_python_projects/blob/world_of_supply/fix_errors/world_of_supply/world_of_supply_rllib_training.py) at line 228

```auto
result = ppo_trainer.train()

```

How do I resolve this?
