Ошибка авторизации vk_api

import vk_api
from config import LOGIN, PASSWORD


def auth_handler():
    key = input("Enter authentication code: ")
    remember_device = True

    return key, remember_device


def main():
    login, password = LOGIN, PASSWORD
    vk_session = vk_api.VkApi(
        login, password,
        auth_handler=auth_handler
    )

    try:
        vk_session.auth(token_only=True)
    except vk_api.AuthError as error_msg:
        print(error_msg)
        return


if __name__ == '__main__':
    main()

Пытаюсь войти в вк с помощью vk_API но выдает вот это

  File "C:\pythonProject\Flask_\main.py", line 25, in <module>
    main()
  File "C:\pythonProject\Flask_\main.py", line 19, in main
    vk_session.auth(token_only=True)
  File "C:\pythonProject\Flask_\venv\lib\site-packages\vk_api\vk_api.py", line 186, in auth
    self._auth_token(reauth=reauth)
  File "C:\pythonProject\Flask_\venv\lib\site-packages\vk_api\vk_api.py", line 226, in _auth_token
    self._api_login()
  File "C:\pythonProject\Flask_\venv\lib\site-packages\vk_api\vk_api.py", line 504, in _api_login
    self.token = response.json()['response']
KeyError: 'response'

Ответы (0 шт):