# Api\_Key or missing 1 required positional argument: 'client' for PO sample apps local deploy

**URL:** <https://discourse.pollination.solutions/t/api-key-or-missing-1-required-positional-argument-client-for-po-sample-apps-local-deploy/1661>\
**Category:** Scripting\
**Created:** [May 26, 2022, 2:51pm UTC](https://discourse.pollination.solutions/t/api-key-or-missing-1-required-positional-argument-client-for-po-sample-apps-local-deploy/1661 "2022-05-26T14:51:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sobrado](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/sobrado/32/12183_2.png) [@sobrado](https://discourse.pollination.solutions/u/sobrado)\
**Post date:** [May 26, 2022, 2:51pm UTC](https://discourse.pollination.solutions/t/api-key-or-missing-1-required-positional-argument-client-for-po-sample-apps-local-deploy/1661/1 "2022-05-26T14:51:21Z")

</div>

Hi, I have been working on the idea of building our web app based on both pollination and streamlit structure.  
I’m fairly new at python coding but I got to the point to embrace this new journey, and like many start-ups, I just fount my first stone on the road.  
After following the getting started tutorial include in this depository:  
[GitHub - pollination/guides: Developer guides for interacting with Pollination.](https://github.com/pollination/guides.git). Id realize that the best way to identify yourself as a Pollination cloud client is by using “import httpx”  
to set a class const like this one:  
class Const:  
api\_key = os.environ[‘POLLINATION\_API\_KEY’]  
url = ‘[https://api.pollination.cloud](https://api.pollination.cloud)’

```
class Endpoints:
    user = '/user'

```

headers = {  
‘x-pollination-token’: Const.api\_key  
}

client = httpx.Client(headers=headers, base\_url=Const.url)

res = client.get(Const.Endpoints.user)

I wanted to deploy as an exercise the energy-simulation-report sample app located in Pollination Github [GitHub - pollination/sample-apps: A collection of sample apps for Pollination](https://github.com/pollination/sample-apps.git)  
Id clone one repository locally and my inside GitHub account as well.  
The python script used for this sample app does not use httpx to recognize the Api\_key o the"client".  
My issue is whether I try to deploy the app locally or by streamlit website. It shows the same error:  
“TypeError: run\_selector() missing 1 required positional argument: ‘client’”  
I’m sure I’m missing something " obvious" but I cut use some help from my LBT friends.  
This is one of the phyton scrips I was trying to deploy.  
[GitHub - Sobradodawley/energy-simulation-report: pollination app test](https://github.com/Sobradodawley/energy-simulation-report.git)

---

<div class="post-metadata">

**Author:** ![mostapha](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/mostapha/32/5761_2.png) [@mostapha](https://discourse.pollination.solutions/u/mostapha)\
**Post date:** [May 26, 2022, 4:25pm UTC](https://discourse.pollination.solutions/t/api-key-or-missing-1-required-positional-argument-client-for-po-sample-apps-local-deploy/1661/2 "2022-05-26T16:25:06Z")

</div>

> [@sobrado](#):
>
> It shows the same error:  
> “TypeError: run\_selector() missing 1 required positional argument: ‘client’”

Hi @sobrado, this is because of a mismatch in the versions of the library and the code. Try it with this new repository which is the updated version of the same app with the correct dependencies.

> **[GitHub - pollination-apps/energy-simulation-report: An app to visualize the HTML report generated by...](https://github.com/pollination-apps/energy-simulation-report)**
>
> An app to visualize the HTML report generated by EnergyPlus / OpenStudio

---

<div class="post-metadata">

**Author:** ![mostapha](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/mostapha/32/5761_2.png) [@mostapha](https://discourse.pollination.solutions/u/mostapha)\
**Post date:** [May 26, 2022, 4:26pm UTC](https://discourse.pollination.solutions/t/api-key-or-missing-1-required-positional-argument-client-for-po-sample-apps-local-deploy/1661/3 "2022-05-26T16:26:27Z")

</div>

For setting up the API Key correctly refer to this section of the guide:

> **[guides/getting-started at master · pollination/guides - Set Environment Variables](https://github.com/pollination/guides/tree/master/getting-started#set-environment-variables)**
>
> master/getting-started

---

<div class="post-metadata">

**Author:** ![mostapha](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/mostapha/32/5761_2.png) [@mostapha](https://discourse.pollination.solutions/u/mostapha)\
**Post date:** [June 12, 2022, 5:14pm UTC](https://discourse.pollination.solutions/t/api-key-or-missing-1-required-positional-argument-client-for-po-sample-apps-local-deploy/1661/4 "2022-06-12T17:14:05Z")

</div>

@sobrado, is this issue resolved?
