# Mopidy installed from both apt and pip causing issues

**URL:** <https://discourse.mopidy.com/t/mopidy-installed-from-both-apt-and-pip-causing-issues/222>\
**Category:** Misc\
**Created:** [October 1, 2014, 5:40pm UTC](https://discourse.mopidy.com/t/mopidy-installed-from-both-apt-and-pip-causing-issues/222 "2014-10-01T17:40:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rawdlite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/rawdlite/32/764_2.png) [@rawdlite](https://discourse.mopidy.com/u/rawdlite)\
**Post date:** [October 1, 2014, 5:40pm UTC](https://discourse.mopidy.com/t/mopidy-installed-from-both-apt-and-pip-causing-issues/222/1 "2014-10-01T17:40:21Z")

</div>

I write this in the hope that it might be useful for anybody who experiences this error.  
Took me a couple of hours to figure it out.  
It turned out that i had two mopidy executables on my ubuntu system. This obviously resulted from pip installing in /usr/local/bin and apt-get installed in /usr/bin. Also ubuntu decided to change the ownership of my ~/.config/mopidy/mopidy.conf to root.  
Also ubuntu wants to run the mopidy damon under a user mopidy and expects its config files under /etc/mopidy and /etc/mopidy/extensions.d.  
While this all makes sense, it conflicts with the setup under /usr/local/bin which (at least on my system) gets called before /usr/bin.  
I am pretty sure i already deleted /usr/local/bin/mopidy once, but pip install seems to have recreated it.  
So either let ubuntu start the daemon and put your config in /etc/mopidy or start from the commandline with full /usr/bin/mopidy path.

HTH

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [October 1, 2014, 6:35pm UTC](https://discourse.mopidy.com/t/mopidy-installed-from-both-apt-and-pip-causing-issues/222/2 "2014-10-01T18:35:25Z")

</div>

I believe this will be fixed in the next release but thanks for taking the time to post here.

---

<div class="post-metadata">

**Author:** ![jodal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jodal/32/2564_2.png) [@jodal](https://discourse.mopidy.com/u/jodal)\
**Post date:** [October 1, 2014, 8:16pm UTC](https://discourse.mopidy.com/t/mopidy-installed-from-both-apt-and-pip-causing-issues/222/3 "2014-10-01T20:16:20Z")

</div>

Not sure what the subject has to do with the rest of your post, but…

The Mopidy Debian package or Ubuntu should under no circumstances change the ownership of `~/.config/mopidy/mopidy.conf`. If you can reproduce that, please file a bug against Mopidy.

The Debian package of Mopidy, as of version 0.19.4-2 (available from [apt.mopidy.com](http://apt.mopidy.com) and in Debian, but not in Ubuntu until after the 14.10 release) has moved the installation of the `mopidy` Python package, so that `pip install Mopidy-Some-Extension` will find Mopidy and not install a second copy with an executable at `/usr/local/bin/mopidy`.

If you’re running Mopidy from Debian package 0.19.4-2 or newer (check with `dpkg -l mopidy`), you should be able to uninstall the pip-installed Mopidy with `sudo pip uninstall mopidy`, and it should not any more be reinstalled when you pip-install a new extension.

---

<div class="post-metadata">

**Author:** ![rawdlite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/rawdlite/32/764_2.png) [@rawdlite](https://discourse.mopidy.com/u/rawdlite)\
**Post date:** [October 1, 2014, 10:11pm UTC](https://discourse.mopidy.com/t/mopidy-installed-from-both-apt-and-pip-causing-issues/222/4 "2014-10-01T22:11:11Z")

</div>

Actually /etc/mopidy/mopidy.conf was a sym link to my ~/config/mopidy/mopidy.conf.  
Probably this link was created by me some time ago and i forgot about it. So i guess the Ubuntu Package just touched /etc/mopidy/mopidy.conf and thereby changing the permission of the link target.  
My bad, i guess. Droped the link now and let ubuntu have its way.

I am running Mopidy 0.19.4-2 on Ubuntu  
/usr/bin/mopidy: is a symbolic link to `…/share/mopidy/mopidy-cmd’

```
sudo pip uninstall mopidy

```

gives:

```
Uninstalling Mopidy:
  /usr/lib/python2.7/dist-packages/Mopidy-0.19.4.egg-info
  /usr/lib/python2.7/dist-packages/mopidy
  /usr/share/mopidy/mopidy-cmd

```

removing the file /usr/bin/mopidy is linked to. No so good.  
/usr/local/bin/mopidy OTOH is a python script:

```
#!/usr/bin/python

# -*- coding: utf-8 -*-
import re
import sys

from mopidy. __main__ import main

if __name__ == ' __main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

```

This scripts returns the right version but when started produces the error in the headline.  
As far as i am concerned this is not an issue since the daemon running under user mopidy has the correct PATH settings.

On a slightly related note: if there is no sound for user mopidy, it might be an alsasink device definition that relies on a ~/.asoundrc not present for user mopidy. At least that one did not take me quite that long to figure.

---

<div class="post-metadata">

**Author:** ![jodal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jodal/32/2564_2.png) [@jodal](https://discourse.mopidy.com/u/jodal)\
**Post date:** [October 2, 2014, 7:23am UTC](https://discourse.mopidy.com/t/mopidy-installed-from-both-apt-and-pip-causing-issues/222/5 "2014-10-02T07:23:50Z")

</div>

> [@rawdlite](#):
>
> sudo pip uninstall mopidy
> 
> gives:
> 
> Uninstalling Mopidy:  
> /usr/lib/python2.7/dist-packages/Mopidy-0.19.4.egg-info  
> /usr/lib/python2.7/dist-packages/mopidy  
> /usr/share/mopidy/mopidy-cmd

All of these files are “owned” by the Debian package and should not be touched by pip.

My guess: You’ve already removed the pip-installed Mopidy, and just have the `/usr/local/bin/mopidy` file left causing issues.

---

<div class="post-metadata">

**Author:** ![rawdlite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/rawdlite/32/764_2.png) [@rawdlite](https://discourse.mopidy.com/u/rawdlite)\
**Post date:** [October 2, 2014, 7:36am UTC](https://discourse.mopidy.com/t/mopidy-installed-from-both-apt-and-pip-causing-issues/222/6 "2014-10-02T07:36:55Z")

</div>

ok will delete /usr/local/bin/mopidy then and see what happens.
