Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named pylast #239

Closed
1 of 2 tasks
NickVst opened this issue Dec 14, 2017 · 6 comments
Closed
1 of 2 tasks

ImportError: No module named pylast #239

NickVst opened this issue Dec 14, 2017 · 6 comments

Comments

@NickVst
Copy link

NickVst commented Dec 14, 2017

Expected behavior

After installing mopidy-iris and starting mopidy, I'd expect to browse to the mopidy web interface and see Iris.

Actual behavior

Iris is not in the list of extensions.

Steps to replicate

  1. Install mopidy-iris. pip installl mopidy-iris
  2. (re)start mopidy. sudo systemctl restart mopidy.service
  3. Browse to web interface. In my case http://satori:6680/
  4. Be greeted with the below screen.

Web clients which are installed as Mopidy extensions will automatically appear here. Or not.

Tested environment(s)

Operating systems affected

  • Linux: Ubuntu server 16.04
  • Others: Untested.

Additional details, debug data, logs, etc

cat /var/log/mopidy/mopidy.log

Logs show that pylast isn't installed.

2017-12-14 16:42:18,116 ERROR [26998:MainThread] mopidy.ext: Failed to load extension iris: No module named pylast
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/ext.py", line 202, in load_extensions
    extension_class = entry_point.load(require=False)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_iris/__init__.py", line 12, in <module>
    from core import IrisCore
  File "/usr/local/lib/python2.7/dist-packages/mopidy_iris/core.py", line 4, in <module>
    import random, string, logging, json, pykka, pylast, urllib, urllib2, os, sys, mopidy_iris, subprocess
ImportError: No module named pylast

Okay, so I'll pip install pylast.

nick@satori:~$ pip install pylast
Requirement already satisfied: pylast in ./.local/lib/python2.7/site-packages
Requirement already satisfied: six in ./.local/lib/python2.7/site-packages (from pylast)

Hm. Does it work?

nick@satori:~$ python2
Python 2.7.12 (default, Nov 20 2017, 18:23:56)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylast
>>>

Well, it imports, and I know too little about python to know where the issue lies. So any assistance would be appreciated.

@NickVst
Copy link
Author

NickVst commented Dec 14, 2017

In classic just-after-you-post fashion, I figured out that the package was installed locally instead of globally.

Ran sudo -H pip install pylast to have it install in /usr/lib/python2.7/dist-packages. Did the job. Next error on the list is No module named raven, so I assume I'll have to go down the rabbithole and install all missing deps (unless there is a way to get them all in global?)

@NickVst
Copy link
Author

NickVst commented Dec 14, 2017

Final message for me, I fixed it by installing packages one-by-one when they appear in the log with sudo -H pip install <packagename>.

The packages that were issues were as follows:

  • pylast
  • raven
  • ConfigObj
  • Mopidy-Local-Images

Although this is a fix, I'm not sure why this happened and if it should, so I'm keeping this issue open for you to decide.

@jaedb
Copy link
Owner

jaedb commented Dec 18, 2017

Cheers for exploring this - it does seem particularly odd. All the Python dependencies are defined in setup.py, as per:

    ...
    install_requires=[
        'setuptools >= 3.3',
        'pylast >= 1.6.0',
        'Mopidy >= 2.0',
        'Mopidy-Local-Images >= 1.0',
        'ConfigObj >= 5.0.6',
        'raven >= 6.1.0',
        'requests >= 2.0.0'
    ],
    ...

So it seems really weird for some OS' to not respect these dependencies. I'll try creating a vanilla VirtualBox of Ubuntu Server 16 to see if I can replicate this.

@jaedb jaedb added the bug label Dec 18, 2017
@jaedb
Copy link
Owner

jaedb commented Dec 21, 2017

I've installed a vanilla Ubutnu 16 instance and have installed Iris without any problems. This suggests the issue might be to do with a previous installation of Iris or pip on your machine.

I would suggest upgrading pip (pip install --upgrade pip), and reinstalling Iris (pip install --upgrade --force-reinstall mopidy-iris). You could also try using the --ignore-installed switch to force install of dependencies as well.

@jaedb
Copy link
Owner

jaedb commented Apr 12, 2018

@NickVst can you please confirm whether this problem is still relevant? If not, please feel free to close the issue.

@jaedb jaedb added the stale label Apr 12, 2018
@NickVst
Copy link
Author

NickVst commented Apr 13, 2018

Unfortunately I haven't used Iris in a while. I'm pretty confident it would've been a previous installation of pip that caused the issues, anyway. I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants