mymedia2 / vk-cli

Vkontakte (vk.com) messenger with CLI for geeks
GNU Lesser General Public License v3.0
9 stars 2 forks source link

Не запускается #1

Open iSarCasm opened 8 years ago

iSarCasm commented 8 years ago
   ~/Downloads/vk-cli  sudo python3 ./setup.py install                                                  1 ↵
[sudo] password for sarcasm: 
running install
Checking .pth file support in /usr/local/lib/python3.4/dist-packages/
/usr/bin/python3 -E -c pass
TEST PASSED: /usr/local/lib/python3.4/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing requirements to vk_cli.egg-info/requires.txt
writing vk_cli.egg-info/PKG-INFO
writing dependency_links to vk_cli.egg-info/dependency_links.txt
writing top-level names to vk_cli.egg-info/top_level.txt
writing entry points to vk_cli.egg-info/entry_points.txt
reading manifest file 'vk_cli.egg-info/SOURCES.txt'
writing manifest file 'vk_cli.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to install

creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/vk_cli-0.01-py3.4.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing vk_cli-0.01-py3.4.egg
Removing /usr/local/lib/python3.4/dist-packages/vk_cli-0.01-py3.4.egg
Copying vk_cli-0.01-py3.4.egg to /usr/local/lib/python3.4/dist-packages
vk-cli 0.01 is already the active version in easy-install.pth
Installing vk-cli script to /usr/local/bin

Installed /usr/local/lib/python3.4/dist-packages/vk_cli-0.01-py3.4.egg
Processing dependencies for vk-cli==0.01
Searching for vk==2.0.2
Best match: vk 2.0.2
Processing vk-2.0.2-py3.4.egg
vk 2.0.2 is already the active version in easy-install.pth

Using /usr/local/lib/python3.4/dist-packages/vk-2.0.2-py3.4.egg
Searching for requests==2.9.1
Best match: requests 2.9.1
Processing requests-2.9.1-py3.4.egg
requests 2.9.1 is already the active version in easy-install.pth

Using /usr/local/lib/python3.4/dist-packages/requests-2.9.1-py3.4.egg
Finished processing dependencies for vk-cli==0.01

   ~/Downloads/vk-cli vk-cli

Traceback (most recent call last):
  File "/usr/local/bin/vk-cli", line 9, in <module>
    load_entry_point('vk-cli==0.01', 'console_scripts', 'vk-cli')()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named 'vk_cli'
mymedia2 commented 8 years ago

Чтобы программа работала, её нужно установить. Для этого запустите скрипт python3 ./setup.py install от имени суперпользователя. Если вы не хотите запускать мой код с root-правами, можете воспользоваться venv.

К сожалению, с лета 2015 года сторонняя библиотека vk не может авторизовываться по логину и паролю. Вам придётся вручную получить ключ доступа у ВК и прописать его в файле ~/.vk-cli.conf, который имеет следующий формат: {'access_token': 'ваш_токен_вк'}

ID моего приложения: 4755710 Значение параметра display: любое допустимое Версия API: любая, не ниже 5.20 Выдайте права messages и offline

В принципе, достаточно выполнить такой запрос https://oauth.vk.com/authorize?client_id=4755710&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=messages,offline&response_type=token&v=5.42, а затем, когда выдадите права, возмите значение параметра access_token из URL вида https://oauth.vk.com/blank.html#access_token= ваш_токен&expires_in=0&user_id=ваш_ид

В ближайшее время я вряд ли буду продолжать разработку этого приложения. На данный момент оно может лишь отображать список диалогов и их содержимое, можно отправлять собщения, правда, не в интерактивном режиме. Не пинайте сильно — это мой первый проект.

iSarCasm commented 8 years ago

Пишет что установилось, но не запускается нифига

mymedia2 commented 8 years ago

К сожалению, не знаю, как быстро исправить проблему. Но, возможно, такой костыль сработает…

sudo pip3 install vk==1.5
python3 -c '__import__("sys").argv[0]="vk-cli";__import__("vk_cli").app()'
CrowbarVik commented 8 years ago

ошибки при утановке. Так и надо ?

~/vk-cli > sudo python3 ./setup.py install
running install
Checking .pth file support in /usr/local/lib/python3.4/dist-packages/
/usr/bin/python3 -E -c pass
TEST PASSED: /usr/local/lib/python3.4/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing top-level names to vk_cli.egg-info/top_level.txt
writing requirements to vk_cli.egg-info/requires.txt
writing entry points to vk_cli.egg-info/entry_points.txt
writing vk_cli.egg-info/PKG-INFO
writing dependency_links to vk_cli.egg-info/dependency_links.txt
writing manifest file 'vk_cli.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/user.py -> build/bdist.linux-x86_64/egg/vk_cli
creating build/bdist.linux-x86_64/egg/vk_cli/locales
copying build/lib/vk_cli/locales/ru.ini.py -> build/bdist.linux-x86_64/egg/vk_cli/locales
copying build/lib/vk_cli/locales/ua.ini.py -> build/bdist.linux-x86_64/egg/vk_cli/locales
copying build/lib/vk_cli/locales/en.ini.py -> build/bdist.linux-x86_64/egg/vk_cli/locales
copying build/lib/vk_cli/locales/by.ini.py -> build/bdist.linux-x86_64/egg/vk_cli/locales
copying build/lib/vk_cli/locales/__init__.py -> build/bdist.linux-x86_64/egg/vk_cli/locales
copying build/lib/vk_cli/vkontakte.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/sender.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/messages.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/router.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/interact.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/dialogs.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/console.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/__init__.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/singleton.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/settings.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/feature_interface.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/app.py -> build/bdist.linux-x86_64/egg/vk_cli
copying build/lib/vk_cli/hub.py -> build/bdist.linux-x86_64/egg/vk_cli
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/user.py to user.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/locales/ru.ini.py to ru.ini.cpython-34.pyc
  File "build/bdist.linux-x86_64/egg/vk_cli/locales/ru.ini.py", line 2
    program_description=Мессенджер ВКонтаке с CLI для гиков
                                          ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/vk_cli/locales/ua.ini.py to ua.ini.cpython-34.pyc
  File "build/bdist.linux-x86_64/egg/vk_cli/locales/ua.ini.py", line 2
    program_description=Месенджер ВКонтаке з CLI для гиків
                                         ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/vk_cli/locales/en.ini.py to en.ini.cpython-34.pyc
  File "build/bdist.linux-x86_64/egg/vk_cli/locales/en.ini.py", line 2
    program_description=Messenger Vkontakte with CLI for geeks
                                          ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/vk_cli/locales/by.ini.py to by.ini.cpython-34.pyc
  File "build/bdist.linux-x86_64/egg/vk_cli/locales/by.ini.py", line 2
    program_description=Мессенджер ВКонтаке з CLI для гікаў
                                          ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/vk_cli/locales/__init__.py to __init__.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/vkontakte.py to vkontakte.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/sender.py to sender.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/messages.py to messages.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/router.py to router.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/interact.py to interact.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/dialogs.py to dialogs.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/console.py to console.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/__init__.py to __init__.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/singleton.py to singleton.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/settings.py to settings.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/feature_interface.py to feature_interface.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/app.py to app.cpython-34.pyc
byte-compiling build/bdist.linux-x86_64/egg/vk_cli/hub.py to hub.cpython-34.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying vk_cli.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
vk_cli.locales.__pycache__.__init__.cpython-34: module references __file__
creating 'dist/vk_cli-0.01-py3.4.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing vk_cli-0.01-py3.4.egg
removing '/usr/local/lib/python3.4/dist-packages/vk_cli-0.01-py3.4.egg' (and everything under it)
creating /usr/local/lib/python3.4/dist-packages/vk_cli-0.01-py3.4.egg
Extracting vk_cli-0.01-py3.4.egg to /usr/local/lib/python3.4/dist-packages
  File "/usr/local/lib/python3.4/dist-packages/vk_cli-0.01-py3.4.egg/vk_cli/locales/ru.ini.py", line 2
    program_description=Мессенджер ВКонтаке с CLI для гиков
                                          ^
SyntaxError: invalid syntax

  File "/usr/local/lib/python3.4/dist-packages/vk_cli-0.01-py3.4.egg/vk_cli/locales/ua.ini.py", line 2
    program_description=Месенджер ВКонтаке з CLI для гиків
                                         ^
SyntaxError: invalid syntax

  File "/usr/local/lib/python3.4/dist-packages/vk_cli-0.01-py3.4.egg/vk_cli/locales/en.ini.py", line 2
    program_description=Messenger Vkontakte with CLI for geeks
                                          ^
SyntaxError: invalid syntax

  File "/usr/local/lib/python3.4/dist-packages/vk_cli-0.01-py3.4.egg/vk_cli/locales/by.ini.py", line 2
    program_description=Мессенджер ВКонтаке з CLI для гікаў
                                          ^
SyntaxError: invalid syntax

vk-cli 0.01 is already the active version in easy-install.pth
Installing vk-cli script to /usr/local/bin

Installed /usr/local/lib/python3.4/dist-packages/vk_cli-0.01-py3.4.egg
Processing dependencies for vk-cli==0.01
Searching for vk==1.5
Best match: vk 1.5
Adding vk 1.5 to easy-install.pth file

Using /usr/local/lib/python3.4/dist-packages
Searching for requests==2.9.1
Best match: requests 2.9.1
Processing requests-2.9.1-py3.4.egg
requests 2.9.1 is already the active version in easy-install.pth

Using /usr/local/lib/python3.4/dist-packages/requests-2.9.1-py3.4.egg
Finished processing dependencies for vk-cli==0.01

П.С. Если запускать через "python3 -c 'import("sys").argv[0]="vk-cli";import("vk_cli").app()'" то он выводит список диалогов и закрывается. Так и надо ?

mymedia2 commented 8 years ago

Да, пока оно только в таком состоянии. :disappointed: Можете, правда, создать файлик с именем vk-cli и содержимым

#!/usr/bin/python3
import vk_cli
vk_cli.app()

и запускать его. Есть справка по ключю --help.

В ветке interactive-mode есть некоторое подобие интерактивного режима.