I
I
Ilya Timofeev2020-06-01 13:14:40
Python
Ilya Timofeev, 2020-06-01 13:14:40

How to use methods in vk_api in python-e?

VK has a site where various methods are written. (click here to follow the link ). As far as I understand, all functions should be taken here. I tried - but even when using the very first method, an error occurs due to the fact that the compiler does not understand what account means. You can ask for explanations on how to use it or what to do with it at all.
THE CODE:

import vk_api

login, password = "не скажу", "не скажу"
vk_session = vk_api.VkApi(login=login, password=password, app_id=2685278)
vk_session.auth(token_only=True)
account.ban(owner_id='578785088')

MISTAKE:
Traceback (most recent call last):
  File "C:/Users/Ilya/Desktop/Bot2/Ban.py", line 1, in <module>
    from vk_api import account
ImportError: cannot import name 'account' from 'vk_api' (C:\Users\Ilya\Desktop\Bot2\venv\lib\site-packages\vk_api\__init__.py)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-06-01
@tim_2007

I don't understand what you don't understand. And your short text you did not explain the essence of the issue. But without even understanding the essence of the issue and having never used this API, I go and write in Google " vk-api python " and get the repository on github with the very first link .
On the main page of the project in the readme, a link with examples . Well, it's impossible not to see.
I don't understand what you don't understand. Where in my actions was something not obvious? How do you even answer your question?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question