I cant get account info

I have just installed python-binance and trying to reach my account but get_account is not working properly. Can you help about the problem?

import os
from binance.client import Client
import time
import datetime

api_key = os.environ.get(‘binance_api’)
api_secret = os.environ.get(‘binance_secret’)

client = Client(api_key, api_secret)

print(client.get_account())

Error message is:
Traceback (most recent call last):
File “C:/iDeal/islemler/Binance/Binance.py”, line 11, in
print(client.get_account())
File “D:\Users\ozgur.yalcin\Anaconda3\envs\Anaconda\lib\site-packages\binance\client.py”, line 1767, in get_account
return self._get(‘account’, True, data=params)
File “D:\Users\ozgur.yalcin\Anaconda3\envs\Anaconda\lib\site-packages\binance\client.py”, line 237, in _get
return self._request_api(‘get’, path, signed, version, **kwargs)
File “D:\Users\ozgur.yalcin\Anaconda3\envs\Anaconda\lib\site-packages\binance\client.py”, line 202, in _request_api
return self._request(method, uri, signed, **kwargs)
File “D:\Users\ozgur.yalcin\Anaconda3\envs\Anaconda\lib\site-packages\binance\client.py”, line 180, in _request
kwargs[‘data’][‘signature’] = self._generate_signature(kwargs[‘data’])
File “D:\Users\ozgur.yalcin\Anaconda3\envs\Anaconda\lib\site-packages\binance\client.py”, line 135, in _generate_signature
m = hmac.new(self.API_SECRET.encode(‘utf-8’), query_string.encode(‘utf-8’), hashlib.sha256)
AttributeError: ‘NoneType’ object has no attribute ‘encode’

I don’t think you retrieved your secret by this (And it’s not wise to configure key/secret in your env vars)

This is pure Python issue. Please google the solution or hard code key/secret and try again

I have the same problem than you @ozyalcin. Have you been able to fix it ?
Many thanks for your help.
All the best

I was able to fix it. mow was right. We should change the way to get the keys by not using the env vars. Thanks for that.