duneanalytics / duneapi-client-python

BSD 3-Clause "New" or "Revised" License
9 stars 0 forks source link

'NoneType' object has no attribute 'encode' #3

Open masapasa opened 2 years ago

masapasa commented 2 years ago

python duneapi.py 1105134 Traceback (most recent call last): File "duneapi-client-python/duneapi.py", line 106, in rows = execute_query_and_get_results(query_id, api_key) File "duneapi-client-python/duneapi.py", line 81, in execute_query_and_get_results dune = DuneAPI(api_key) File "duneapi-client-python/duneapi.py", line 25, in init self.client = httpx.Client(headers=self.headers) File "anaconda3/envs/jina/lib/python3.9/site-packages/httpx/_client.py", line 647, in init super().init( File "anaconda3/envs/jina/lib/python3.9/site-packages/httpx/_client.py", line 179, in init self.headers = Headers(headers) File "anaconda3/envs/jina/lib/python3.9/site-packages/httpx/_models.py", line 69, in init self._list = [ File "anaconda3/envs/jina/lib/python3.9/site-packages/httpx/_models.py", line 73, in normalize_header_value(v, encoding), File "anaconda3/envs/jina/lib/python3.9/site-packages/httpx/_utils.py", line 54, in normalize_header_value return value.encode(encoding or "ascii") AttributeError: 'NoneType' object has no attribute 'encode'

SusmeetJain commented 2 years ago

Did you add your API key to your local environment before running this script?

   $ export DUNE_API_KEY="YOUR_API_KEY"