thesquelched / suggestive

Python MPD client with integrated Last.FM support
BSD 2-Clause "Simplified" License
4 stars 0 forks source link

Can't run suggestive on a clean Arch Linux machine #1

Closed shatteringlass closed 10 years ago

shatteringlass commented 10 years ago
~/suggestive ❯❯❯ ./bin/suggestive
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.3/threading.py", line 637, in _bootstrap_inner
    self.run()
  File "./suggestive/threads.py", line 20, in newrun
    orig_run(self)
  File "./suggestive/threads.py", line 107, in run
    lastfm = mstat.initialize_lastfm(conf)
  File "./suggestive/mstat.py", line 380, in initialize_lastfm
    config.lastfm_apikey(),
  File "./suggestive/config.py", line 111, in lastfm_apikey
    return self.parser['lastfm']['api_key']
  File "/usr/lib/python3.3/configparser.py", line 1220, in __getitem__
    raise KeyError(key)
KeyError: 'api_key'

Traceback (most recent call last):
  File "/usr/lib/python3.3/runpy.py", line 160, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python3.3/runpy.py", line 73, in _run_code
    exec(code, run_globals)
  File "./suggestive/__main__.py", line 6, in <module>
    main()
  File "./suggestive/app.py", line 1469, in main
    run(parser.parse_args())
  File "./suggestive/app.py", line 1453, in run
    app = Application(conf, main_session)
  File "./suggestive/app.py", line 783, in __init__
    self.library_buffer = self.create_library_buffer()
  File "./suggestive/app.py", line 838, in create_library_buffer
    buf = LibraryBuffer(self.conf, self.session)
  File "./suggestive/app.py", line 196, in __init__
    self.default_orderers = list(self.init_default_orderers(conf))
  File "./suggestive/app.py", line 220, in init_default_orderers
    self.execute_command(cmd)
  File "./suggestive/command.py", line 88, in execute_command
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.3/threading.py", line 637, in _bootstrap_inner
    self.run()
  File "./suggestive/threads.py", line 20, in newrun
    orig_run(self)
  File "./suggestive/threads.py", line 51, in run
    mpd = mstat.initialize_mpd(self.conf)
  File "./suggestive/mstat.py", line 373, in initialize_mpd
    client.connect(host, port)
  File "/usr/lib/python3.3/site-packages/mpd.py", line 491, in connect
    self._sock = self._connect_tcp(host, port)
  File "/usr/lib/python3.3/site-packages/mpd.py", line 464, in _connect_tcp
    raise err
  File "/usr/lib/python3.3/site-packages/mpd.py", line 457, in _connect_tcp
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connessione rifiutata

    command_func(*args, **kwargs)
  File "./suggestive/app.py", line 329, in add_func
    self.add_orderer(orderer, *args, **kwArgs)
  File "./suggestive/app.py", line 446, in add_orderer
    self.update_suggestions()
  File "./suggestive/app.py", line 357, in update_suggestions
    self.suggestions = self.get_suggestions()
  File "./suggestive/app.py", line 364, in get_suggestions
    return self.anl.order_albums(self.session, self.orderers)
  File "./suggestive/analytics.py", line 314, in order_albums
    mpd = mstat.initialize_mpd(self.conf)
  File "./suggestive/mstat.py", line 373, in initialize_mpd
    client.connect(host, port)
  File "/usr/lib/python3.3/site-packages/mpd.py", line 491, in connect
    self._sock = self._connect_tcp(host, port)
  File "/usr/lib/python3.3/site-packages/mpd.py", line 464, in _connect_tcp
    raise err
  File "/usr/lib/python3.3/site-packages/mpd.py", line 457, in _connect_tcp
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connessione rifiutata
thesquelched commented 10 years ago

suggestive requires a LastFM API key to operate. If you already have a LastFM account, you can get one on the LastFM API accounts page. Then, you will need to put this in your ~/.suggestive.conf file, as explained in the Configuration section. Make sure to replace the api_key and api_secret with your own from the LastFM API page.

thesquelched commented 10 years ago

Oh, also, make sure that you have mpd running and that the connection information in ~/.suggestive.conf is correct. See https://github.com/thesquelched/suggestive/blob/master/suggestive.conf.example for more information.

shatteringlass commented 10 years ago
~ ❯❯❯ cat suggestive/.suggestive.conf
[lastfm]
user = shatteringlass
api_key = 5665728e2a68432f4276c39616fa8839

[mpd]
host = 10.0.2.2
port = 6600

So you suggest that adding the api_key field is enough?

shatteringlass commented 10 years ago
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.3/threading.py", line 637, in _bootstrap_inner
    self.run()
  File "./suggestive/threads.py", line 20, in newrun
    orig_run(self)
  File "./suggestive/threads.py", line 107, in run
    lastfm = mstat.initialize_lastfm(conf)
  File "./suggestive/mstat.py", line 380, in initialize_lastfm
    config.lastfm_apikey(),
  File "./suggestive/config.py", line 111, in lastfm_apikey
    return self.parser['lastfm']['api_key']
  File "/usr/lib/python3.3/configparser.py", line 1220, in __getitem__
    raise KeyError(key)
KeyError: 'api_key'

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.3/threading.py", line 637, in _bootstrap_inner
    self.run()
  File "./suggestive/threads.py", line 20, in newrun
    orig_run(self)
  File "./suggestive/threads.py", line 51, in run
    mpd = mstat.initialize_mpd(self.conf)
  File "./suggestive/mstat.py", line 373, in initialize_mpd
    client.connect(host, port)
  File "/usr/lib/python3.3/site-packages/mpd.py", line 491, in connect
    self._sock = self._connect_tcp(host, port)
  File "/usr/lib/python3.3/site-packages/mpd.py", line 464, in _connect_tcp
    raise err
  File "/usr/lib/python3.3/site-packages/mpd.py", line 457, in _connect_tcp
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connessione rifiutata

Traceback (most recent call last):
  File "/usr/lib/python3.3/runpy.py", line 160, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python3.3/runpy.py", line 73, in _run_code
    exec(code, run_globals)
  File "./suggestive/__main__.py", line 6, in <module>
    main()
  File "./suggestive/app.py", line 1469, in main
    run(parser.parse_args())
  File "./suggestive/app.py", line 1453, in run
    app = Application(conf, main_session)
  File "./suggestive/app.py", line 783, in __init__
    self.library_buffer = self.create_library_buffer()
  File "./suggestive/app.py", line 838, in create_library_buffer
    buf = LibraryBuffer(self.conf, self.session)
  File "./suggestive/app.py", line 196, in __init__
    self.default_orderers = list(self.init_default_orderers(conf))
  File "./suggestive/app.py", line 220, in init_default_orderers
    self.execute_command(cmd)
  File "./suggestive/command.py", line 88, in execute_command
    command_func(*args, **kwargs)
  File "./suggestive/app.py", line 329, in add_func
    self.add_orderer(orderer, *args, **kwArgs)
  File "./suggestive/app.py", line 446, in add_orderer
    self.update_suggestions()
  File "./suggestive/app.py", line 357, in update_suggestions
    self.suggestions = self.get_suggestions()
  File "./suggestive/app.py", line 364, in get_suggestions
    return self.anl.order_albums(self.session, self.orderers)
  File "./suggestive/analytics.py", line 314, in order_albums
    mpd = mstat.initialize_mpd(self.conf)
  File "./suggestive/mstat.py", line 373, in initialize_mpd
    client.connect(host, port)
  File "/usr/lib/python3.3/site-packages/mpd.py", line 491, in connect
    self._sock = self._connect_tcp(host, port)
  File "/usr/lib/python3.3/site-packages/mpd.py", line 464, in _connect_tcp
    raise err
  File "/usr/lib/python3.3/site-packages/mpd.py", line 457, in _connect_tcp
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connessione rifiutata

This is terminal output after adding api_secret field (yeah, it's pretty much the same as before). Also, mpd is up and running and I can hook ncmpcpp to 10.0.2.2:6600 without problems.

thesquelched commented 10 years ago

I think you just have the config file in the wrong place; suggestive actually doesn't look in the current directory (there was a slight typo in the README file). You can test this using the -c CLI option, e.g. bin/suggestive -c <PATH TO FILE>. You can also just copy the config file to$HOME/.suggestive.conf`. Sorry for the confusion.

shatteringlass commented 10 years ago

Thank you, using ./bin/suggestive -c <'CONF_FILE'> worked just fine. Looking forward to using your app!

thesquelched commented 10 years ago

Thanks for giving it a try! It's in early development now, so bug reports and/or suggestions are welcome.

shatteringlass commented 10 years ago

I am in the process of creating the music library as of now. I am running your app on a virtual machine in my OSX install, in which my mpd server resides. Sadly I had troubles compiling urwid for OSX, so I had to pull this off. I will gladly contribute to bug reporting. Keep up your good work.