# Simple Python Worker

**URL:** <https://community.temporal.io/t/simple-python-worker/8508>\
**Category:** Community Support\
**Tags:** python-sdk\
**Created:** [June 12, 2023, 5:32pm UTC](https://community.temporal.io/t/simple-python-worker/8508 "2023-06-12T17:32:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jingpingw](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@jingpingw](https://community.temporal.io/u/jingpingw)\
**Post date:** [June 12, 2023, 5:32pm UTC](https://community.temporal.io/t/simple-python-worker/8508/1 "2023-06-12T17:32:05Z")

</div>

New to Python SDK and couldn’t get a sample HelloWorld working. Any help is appreciated:  
Error message is at the bottom.

async def run():

```
config = read_config_file("local_test.yaml")
client = await Client.connect("localhost:7233")
async with Worker(
    client,
    task_queue=config.get_client_machine_name(),
    activities=[basic_activity],
    workflows=[BasicJobWorkflow],
):
    result = await client.execute_workflow(
        BasicJobWorkflow.run,
        "test input",
        id=add_uuid_to_string("test_id"),
        task_queue=config.get_client_machine_name(),
    )
    print(f"Result: {result}")

return result

```

def test\_main():  
asyncio.run(run())

* * *

@activity.defn  
async def basic\_activity(s:str) → str :

```
 return s + " activity is completed"

```

@workflow.defn  
class BasicJobWorkflow:

```
@workflow.run
async def run(self, s: str) -> str:
    print("BasicJobWorkflow() started:" + s)
    return s + " is completed" 

```

Error message ------------

Error:  
venv/lib/python3.9/site-packages/temporalio/client.py:2055: in fetch\_next\_page  
history\_event\_filter\_type=temporalio.api.enums.v1.HistoryEventFilterType.ValueType(

* * *

self = \<google.protobuf.internal.enum\_type\_wrapper.EnumTypeWrapper object at 0x7f4024437be0\>  
name = ‘ValueType’

```
def __getattr__ (self, name):
  """Returns the value corresponding to the given enum name."""
  try:
    return super(
        EnumTypeWrapper,
        self). __getattribute__ ('_enum_type').values_by_name[name].number
  except KeyError:
    pass # fall out to break exception chaining

```

> ```
> raise AttributeError('Enum {} has no value defined for name {!r}'.format(
> 
> ```

```
      self._enum_type.name, name))

```

E AttributeError: Enum HistoryEventFilterType has no value defined for name ‘ValueType’

venv/lib/python3.9/site-packages/google/protobuf/internal/enum\_type\_wrapper.py:114: AttributeError

============================== 1 failed in 0.42s ===============================

Process finished with exit code 1

---

<div class="post-metadata">

**Author:** ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)\
**Post date:** [June 12, 2023, 5:49pm UTC](https://community.temporal.io/t/simple-python-worker/8508/2 "2023-06-12T17:49:17Z")

</div>

Do you have a specific version of protobuf for your sample? What version if protobuf is in your venv?

---

<div class="post-metadata">

**Author:** ![jingpingw](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@jingpingw](https://community.temporal.io/u/jingpingw)\
**Post date:** [June 13, 2023, 3:25am UTC](https://community.temporal.io/t/simple-python-worker/8508/3 "2023-06-13T03:25:29Z")

</div>

It shows 3.19.0

$ python -m pip show protobuf  
Name: protobuf  
Version: 3.19.0  
Summary: Protocol Buffers  
Home-page: [Protocol Buffers Documentation](https://developers.google.com/protocol-buffers/)  
Author:  
Author-email:  
License: 3-Clause BSD License  
Location: /home/jingpingw/gitlab/cloud-infa/srl/srl-py-client/venv/lib/python3.9/site-packages  
Requires:  
Required-by: temporalio

---

<div class="post-metadata">

**Author:** ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)\
**Post date:** [June 13, 2023, 12:36pm UTC](https://community.temporal.io/t/simple-python-worker/8508/4 "2023-06-13T12:36:21Z")

</div>

We require [\>= 3.20](https://github.com/temporalio/sdk-python/blob/e1d983e226d055424a6c3404651079b23a44f5f0/pyproject.toml#L37) specifically for this reason. See first note on [this PR](https://github.com/temporalio/sdk-python/pull/231) about needing [this proto commit](https://github.com/protocolbuffers/protobuf/commit/0707f2e7f556c8396d6027d0533ec3a56d1061db). I am surprised that the `pip` dependency resolver allowed less than 3.20 unless you’re using an old SDK version.

---

<div class="post-metadata">

**Author:** ![jingpingw](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@jingpingw](https://community.temporal.io/u/jingpingw)\
**Post date:** [June 13, 2023, 10:19pm UTC](https://community.temporal.io/t/simple-python-worker/8508/5 "2023-06-13T22:19:09Z")

</div>

Yes, that was it. Thank you!
