Install issue on OSx #330

Closed
gilbertbw opened this Issue Feb 16, 2013 · 9 comments

Comments

4 participants
@gilbertbw

When running sudo pip install -U pyspotify pylast pykka mopidy

I recive this error:

clang: warning: argument unused during compilation: '-mno-fused-madd'
src/module.c:3:10: fatal error: 'libspotify/api.h' file not found
#include "libspotify/api.h"
         ^
1 error generated.
error: command 'clang' failed with exit status 1
@kingosticks

This comment has been minimized.

Show comment Hide comment
@kingosticks

kingosticks Feb 16, 2013

Member

But libspotify is definitely installed? I.e.
brew install gst-python gst-plugins-good gst-plugins-ugly libspotify

Member

kingosticks commented Feb 16, 2013

But libspotify is definitely installed? I.e.
brew install gst-python gst-plugins-good gst-plugins-ugly libspotify

@RobinAstle

This comment has been minimized.

Show comment Hide comment
@RobinAstle

RobinAstle Feb 17, 2013

I managed to get it to work using a mixture of homebrew and macports. Can't exactly recall what packages I got from where though.

----- Reply message -----
From: "Nick Steel" notifications@github.com
To: "mopidy/mopidy" mopidy@noreply.github.com
Subject: [mopidy] Install issue on OSx (#330)
Date: Sat, Feb 16, 2013 23:03
But libspotify is definitely installed? I.e.
brew install gst-python gst-plugins-good gst-plugins-ugly libspotify

Reply to this email directly or view it on GitHub.

I managed to get it to work using a mixture of homebrew and macports. Can't exactly recall what packages I got from where though.

----- Reply message -----
From: "Nick Steel" notifications@github.com
To: "mopidy/mopidy" mopidy@noreply.github.com
Subject: [mopidy] Install issue on OSx (#330)
Date: Sat, Feb 16, 2013 23:03
But libspotify is definitely installed? I.e.
brew install gst-python gst-plugins-good gst-plugins-ugly libspotify

Reply to this email directly or view it on GitHub.

@gilbertbw

This comment has been minimized.

Show comment Hide comment
@gilbertbw

gilbertbw Feb 17, 2013

I re-ran brew install libspotify but the pid command now works but running `mopidy' causes this error:

Traceback (most recent call last):
  File "/usr/local/bin/mopidy", line 4, in <module>
    from mopidy.__main__ import main
  File "/Library/Python/2.7/site-packages/mopidy/__init__.py", line 30, in <module>
    from mopidy.utils.settings import SettingsProxy
  File "/Library/Python/2.7/site-packages/mopidy/utils/settings.py", line 13, in <module>
    from mopidy.utils import formatting, path
  File "/Library/Python/2.7/site-packages/mopidy/utils/path.py", line 12, in <module>
    import glib
ImportError: No module named glib

I re-ran brew install libspotify but the pid command now works but running `mopidy' causes this error:

Traceback (most recent call last):
  File "/usr/local/bin/mopidy", line 4, in <module>
    from mopidy.__main__ import main
  File "/Library/Python/2.7/site-packages/mopidy/__init__.py", line 30, in <module>
    from mopidy.utils.settings import SettingsProxy
  File "/Library/Python/2.7/site-packages/mopidy/utils/settings.py", line 13, in <module>
    from mopidy.utils import formatting, path
  File "/Library/Python/2.7/site-packages/mopidy/utils/path.py", line 12, in <module>
    import glib
ImportError: No module named glib
@kingosticks

This comment has been minimized.

Show comment Hide comment
@kingosticks

kingosticks Feb 17, 2013

Member

So you've got more missing dependency, looks like python-object which I'd have thought brew would've taken care of when installing the various gst-* packages. I don't have a mac myself but I'm very surprised this doesn't just work.

EDIT: Is gst-python definitely installed? I suggest you re-run the brew install command in it's entirety.

Member

kingosticks commented Feb 17, 2013

So you've got more missing dependency, looks like python-object which I'd have thought brew would've taken care of when installing the various gst-* packages. I don't have a mac myself but I'm very surprised this doesn't just work.

EDIT: Is gst-python definitely installed? I suggest you re-run the brew install command in it's entirety.

@jodal

This comment has been minimized.

Show comment Hide comment
@jodal

jodal Feb 18, 2013

Owner

The glib Python package is provided by the Homebrew formula pygobject.

If you follow the OS X instructions at http://docs.mopidy.com/en/latest/installation/#os-x-install-from-homebrew-and-pip, you should have installed gst-python from Homebrew, which depends on pygtk, which again depends on pygobject, and thus it should work.

Owner

jodal commented Feb 18, 2013

The glib Python package is provided by the Homebrew formula pygobject.

If you follow the OS X instructions at http://docs.mopidy.com/en/latest/installation/#os-x-install-from-homebrew-and-pip, you should have installed gst-python from Homebrew, which depends on pygtk, which again depends on pygobject, and thus it should work.

@jodal

This comment has been minimized.

Show comment Hide comment
@jodal

jodal Feb 20, 2013

Owner

@gilbertbw Did you get it working? :-)

Owner

jodal commented Feb 20, 2013

@gilbertbw Did you get it working? :-)

@gilbertbw

This comment has been minimized.

Show comment Hide comment
@gilbertbw

gilbertbw Feb 24, 2013

No, running brew install gst-python gives Error: gst-python-0.10.22 already installed and the error the glib is not installed is still there

No, running brew install gst-python gives Error: gst-python-0.10.22 already installed and the error the glib is not installed is still there

@jodal

This comment has been minimized.

Show comment Hide comment
@jodal

jodal Feb 25, 2013

Owner

OS X comes bundled with a Python installation. In addition, Homebrew can install (newer) Python versions as well. which python will show you which Python installation you're using. /usr/bin/python indicates OS X Python, while /usr/bin/local/python indicates Homebrew Python. Both are good to go, you just need to be aware of which one you're using. Irrespective of which Python installation you're using, Homebrew will install the Python modules into /usr/local. I'll show you the effect of this...

python -c 'import pprint, sys; pprint.pprint(sys.path)' will show the list of dirs searched for installed Python modules (known as the PYTHONPATH) when you try to import a module.

E.g., on a OS X system I have access to, it looks like this:

$ which python
/usr/bin/python             # OS X Python
$ python --version
Python 2.7.2
$ python -c 'import pprint, sys; pprint.pprint(sys.path)'
['',
 '/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC',
 '/Library/Python/2.7/site-packages',
 '/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
$ python -c 'import glib'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named glib

The pygobject and the glib module is installed:

$ brew list pygobject
/usr/local/Cellar/pygobject/2.28.6/bin/pygobject-codegen-2.0
/usr/local/Cellar/pygobject/2.28.6/include/pygtk-2.0/ (2 files)
/usr/local/Cellar/pygobject/2.28.6/lib/libpyglib-2.0-python.0.dylib
/usr/local/Cellar/pygobject/2.28.6/lib/pkgconfig/pygobject-2.0.pc
/usr/local/Cellar/pygobject/2.28.6/lib/python2.7/ (29 files)
/usr/local/Cellar/pygobject/2.28.6/lib/libpyglib-2.0-python.dylib
/usr/local/Cellar/pygobject/2.28.6/share/gtk-doc/ (57 files)
/usr/local/Cellar/pygobject/2.28.6/share/pygobject/ (71 files)

The reason I can't import the installed glib using my OS X bundled Python is that it's installed in /usr/local/lib/python2.7/site-packages, which isn't included in the list of search paths.

You was probably informed of this caveat when you installed the package, but it drowned in the amount of output from Homebrew. You can check out the instructions using brew info package-name:

$ brew info gst-python
gst-python: stable 0.10.22
http://gstreamer.freedesktop.org/
Depends on: pkg-config, gst-plugins-base, pygtk
/usr/local/Cellar/gst-python/0.10.21 (66 files, 1.6M)
/usr/local/Cellar/gst-python/0.10.22 (70 files, 1.6M) *
https://github.com/mxcl/homebrew/commits/master/Library/Formula/gst-python.rb
==> Caveats
For non-Homebrew Python, you need to amend your PYTHONPATH like so:
  export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

If we update the PYTHONPATH to include Homebrew's site-packages dir as instructed by the caveats section above, importing glib using the OS X bundled Python installation works:

$ export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
$ python -c 'import glib; print dir(glib)[:3]'
['GError', 'IOChannel', 'IO_ERR']

To make the PYTHONPATH permanently include Homebrew's site-packages, add the export line to your shell's init file, typically ~/.bashrc.

Please let me know how this works out for you!

Owner

jodal commented Feb 25, 2013

OS X comes bundled with a Python installation. In addition, Homebrew can install (newer) Python versions as well. which python will show you which Python installation you're using. /usr/bin/python indicates OS X Python, while /usr/bin/local/python indicates Homebrew Python. Both are good to go, you just need to be aware of which one you're using. Irrespective of which Python installation you're using, Homebrew will install the Python modules into /usr/local. I'll show you the effect of this...

python -c 'import pprint, sys; pprint.pprint(sys.path)' will show the list of dirs searched for installed Python modules (known as the PYTHONPATH) when you try to import a module.

E.g., on a OS X system I have access to, it looks like this:

$ which python
/usr/bin/python             # OS X Python
$ python --version
Python 2.7.2
$ python -c 'import pprint, sys; pprint.pprint(sys.path)'
['',
 '/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC',
 '/Library/Python/2.7/site-packages',
 '/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
$ python -c 'import glib'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named glib

The pygobject and the glib module is installed:

$ brew list pygobject
/usr/local/Cellar/pygobject/2.28.6/bin/pygobject-codegen-2.0
/usr/local/Cellar/pygobject/2.28.6/include/pygtk-2.0/ (2 files)
/usr/local/Cellar/pygobject/2.28.6/lib/libpyglib-2.0-python.0.dylib
/usr/local/Cellar/pygobject/2.28.6/lib/pkgconfig/pygobject-2.0.pc
/usr/local/Cellar/pygobject/2.28.6/lib/python2.7/ (29 files)
/usr/local/Cellar/pygobject/2.28.6/lib/libpyglib-2.0-python.dylib
/usr/local/Cellar/pygobject/2.28.6/share/gtk-doc/ (57 files)
/usr/local/Cellar/pygobject/2.28.6/share/pygobject/ (71 files)

The reason I can't import the installed glib using my OS X bundled Python is that it's installed in /usr/local/lib/python2.7/site-packages, which isn't included in the list of search paths.

You was probably informed of this caveat when you installed the package, but it drowned in the amount of output from Homebrew. You can check out the instructions using brew info package-name:

$ brew info gst-python
gst-python: stable 0.10.22
http://gstreamer.freedesktop.org/
Depends on: pkg-config, gst-plugins-base, pygtk
/usr/local/Cellar/gst-python/0.10.21 (66 files, 1.6M)
/usr/local/Cellar/gst-python/0.10.22 (70 files, 1.6M) *
https://github.com/mxcl/homebrew/commits/master/Library/Formula/gst-python.rb
==> Caveats
For non-Homebrew Python, you need to amend your PYTHONPATH like so:
  export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

If we update the PYTHONPATH to include Homebrew's site-packages dir as instructed by the caveats section above, importing glib using the OS X bundled Python installation works:

$ export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
$ python -c 'import glib; print dir(glib)[:3]'
['GError', 'IOChannel', 'IO_ERR']

To make the PYTHONPATH permanently include Homebrew's site-packages, add the export line to your shell's init file, typically ~/.bashrc.

Please let me know how this works out for you!

@jodal

This comment has been minimized.

Show comment Hide comment
@jodal

jodal Mar 30, 2013

Owner

Closing because of no feedback from user for a month.

Owner

jodal commented Mar 30, 2013

Closing because of no feedback from user for a month.

@jodal jodal closed this Mar 30, 2013

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