Логинюсь с помощью пароля и номера телефона, которые запрашиваются у пользователя, выходит ошибка:
Traceback (most recent call last):
File "c:/Users/4iki6/source/botForFriend/perecupbot/bot.py", line 34, in <module>
vk_auth()
File "c:/Users/4iki6/source/botForFriend/perecupbot/bot.py", line 29, in vk_auth
vk_session.auth(token_only=True)
File "C:\Users\4iki6\AppData\Local\Programs\Python\Python37\lib\site-packages\vk_api\vk_api.py", line 184, in auth
self._auth_token(reauth=reauth)
File "C:\Users\4iki6\AppData\Local\Programs\Python\Python37\lib\site-packages\vk_api\vk_api.py", line 235, in _auth_token
self._vk_login()
File "C:\Users\4iki6\AppData\Local\Programs\Python\Python37\lib\site-packages\vk_api\vk_api.py", line 330, in _vk_login
self.storage.save()
File "C:\Users\4iki6\AppData\Local\Programs\Python\Python37\lib\site-packages\jconfig\jconfig.py", line 41, in save
json.dump(self._settings, f, indent=2, sort_keys=True)
File "C:\Users\4iki6\AppData\Local\Programs\Python\Python37\lib\json\__init__.py", line 179, in dump
for chunk in iterable:
File "C:\Users\4iki6\AppData\Local\Programs\Python\Python37\lib\json\encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "C:\Users\4iki6\AppData\Local\Programs\Python\Python37\lib\json\encoder.py", line 353, in _iterencode_dict
items = sorted(dct.items(), key=lambda kv: kv[0])
TypeError: '<' not supported between instances of 'int' and 'str'
Вот код:
def vk_auth():
global password
global phone
global vk_session
global vk
global lp
while True:
try:
phone = int(input("Введите номер телефона: "))
break
except:
continue
password = input("Введите пароль от аккаунта вк: ")
vk_session = vk_api.VkApi(phone, password, scope="wall, photos, friends, groups", api_version="5.131")
vk_session.auth(token_only=True)
vk = vk_session.get_api()
lp = VkLongPoll(vk_session)
vk_auth()