Skip to content

Loading…

Pango not available on python #18189

Closed
camilonova opened this Issue · 8 comments

4 participants

@camilonova

I did installed pago without any issue, but i can't import it from python.

Currently i have this:

$ brew info pango
pango: stable 1.32.6

Seems is working fine:

$ pango-querymodules 
# Pango Modules file
# Automatically generated file, do not edit
#
# ModulesPath = /usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules
#
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-arabic-lang.so ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-basic-coretext.so BasicScriptEngineCoreText PangoEngineShape PangoRenderCoreText common:
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-basic-fc.so BasicScriptEngineFc PangoEngineShape PangoRenderFc common:
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so devaIndicScriptEngineLang PangoEngineLang PangoRenderNone devanagari:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so bengIndicScriptEngineLang PangoEngineLang PangoRenderNone bengali:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so guruIndicScriptEngineLang PangoEngineLang PangoRenderNone gurmukhi:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so gujrIndicScriptEngineLang PangoEngineLang PangoRenderNone gujarati:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so oryaIndicScriptEngineLang PangoEngineLang PangoRenderNone oriya:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so tamlIndicScriptEngineLang PangoEngineLang PangoRenderNone tamil:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so teluIndicScriptEngineLang PangoEngineLang PangoRenderNone telugu:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so kndaIndicScriptEngineLang PangoEngineLang PangoRenderNone kannada:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so mlymIndicScriptEngineLang PangoEngineLang PangoRenderNone malayalam:*
/usr/local/Cellar/pango/1.32.6/lib/pango/1.8.0/modules/pango-indic-lang.so sinhIndicScriptEngineLang PangoEngineLang PangoRenderNone sinhala:*

But here is my problem:

$ python
Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pango
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pango
>>> 

I already have this:

export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

And i was able to do this:

$ python
Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cairo
>>> 

Seems the pango library is not linked to PYTHONPATH

Thanks.

@Sharpie

Works just fine here:

$ python -c 'import pango';echo $?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named pango
1

$ brew install pygtk
# Time passes...
==> Summary
/usr/local/Cellar/pygtk/2.24.0: 658 files, 18M, built in 36 seconds

$ python -c 'import pango';echo $?
0

Do you have pygtk installed?

@camilonova

I just checked again, and is still broken

$ brew install pygtk
Error: pygtk-2.24.0 already installed
$ python -c 'import pango';echo $?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named pango
1

any ideas?

@samueljohn

In /usr/local/lib/python2.7/site-packages do you find a a pango package there?

@fakechris

Try This
python -c "import pygtk;pygtk.require('2.0');import pango";echo $?

@camilonova

Returns 0

Screen Shot 2013-04-03 at 8 46 04 AM

@fakechris why it works that way?

@fakechris

pygtk 3.0 is not compatible with 2.0, you must use pygtk.require('2.0') to import pang and gtk packages that not available in 3.0

@camilonova

Thanks.

@camilonova camilonova closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.