ImportError: could not import pygtk

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

ImportError: could not import pygtk

4625
uname -a
OpenBSD localhost 4.5 200909202109#0 i386
sysctl -n kern.version
OpenBSD 4.5 (200909202109) #0: Sun Sep 20 22:18:12 2009
    root@localhost:/sys/arch/i386/compile/200909202109
pkg_info | grep -i gimp
gimp-2.6.4p0        GNU Image Manipulation Program
gimp-lqr-plugin-0.4.0.4 seam-carving smart rescale gimp plugin

When I run GIMP, he always display these warnings:

Traceback (most recent call last):
  File "/usr/local/lib/gimp/2.0/plug-ins/python-eval.py", line 20, in <module>
    from gimpfu import *
  File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
    import gimp
ImportError: could not import pygtk

(gimp-2.6:24579): LibGimpBase-WARNING **: gimp-2.6: gimp_wire_read(): error
Traceback (most recent call last):
  File "/usr/local/lib/gimp/2.0/plug-ins/python-console.py", line 20, in <module>
    from gimpfu import *
  File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
    import gimp
ImportError: could not import pygtk

(gimp-2.6:24579): LibGimpBase-WARNING **: gimp-2.6: gimp_wire_read(): error
Traceback (most recent call last):
  File "/usr/local/lib/gimp/2.0/plug-ins/py-slice.py", line 31, in <module>
    from gimpfu import *
  File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
    import gimp
ImportError: could not import pygtk

(gimp-2.6:24579): LibGimpBase-WARNING **: gimp-2.6: gimp_wire_read(): error
Traceback (most recent call last):
  File "/usr/local/lib/gimp/2.0/plug-ins/palette-to-gradient.py", line 17, in <module>
    from gimpfu import *
  File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
    import gimp
ImportError: could not import pygtk

(gimp-2.6:24579): LibGimpBase-WARNING **: gimp-2.6: gimp_wire_read(): error
Traceback (most recent call last):
  File "/usr/local/lib/gimp/2.0/plug-ins/palette-sort.py", line 17, in <module>
    from gimpfu import *
  File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
    import gimp
ImportError: could not import pygtk

(gimp-2.6:24579): LibGimpBase-WARNING **: gimp-2.6: gimp_wire_read(): error
Traceback (most recent call last):
  File "/usr/local/lib/gimp/2.0/plug-ins/palette-offset.py", line 17, in <module>
    from gimpfu import *
  File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
    import gimp
ImportError: could not import pygtk

(gimp-2.6:24579): LibGimpBase-WARNING **: gimp-2.6: gimp_wire_read(): error
Traceback (most recent call last):
  File "/usr/local/lib/gimp/2.0/plug-ins/foggify.py", line 20, in <module>
    from gimpfu import *
  File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
    import gimp
ImportError: could not import pygtk

(gimp-2.6:24579): LibGimpBase-WARNING **: gimp-2.6: gimp_wire_read(): error
Traceback (most recent call last):
  File "/usr/local/lib/gimp/2.0/plug-ins/colorxhtml.py", line 25, in <module>
    import gimp
ImportError: could not import pygtk

(gimp-2.6:24579): LibGimpBase-WARNING **: gimp-2.6: gimp_wire_read(): error

--
/Buzzer


Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

Antoine Jacoutot-7
On Sun, 20 Sep 2009, Buzzer wrote:

> uname -a
> OpenBSD localhost 4.5 200909202109#0 i386
> sysctl -n kern.version
> OpenBSD 4.5 (200909202109) #0: Sun Sep 20 22:18:12 2009
>     root@localhost:/sys/arch/i386/compile/200909202109
> pkg_info | grep -i gimp
> gimp-2.6.4p0        GNU Image Manipulation Program
> gimp-lqr-plugin-0.4.0.4 seam-carving smart rescale gimp plugin
>
> When I run GIMP, he always display these warnings:
>
> Traceback (most recent call last):
>   File "/usr/local/lib/gimp/2.0/plug-ins/python-eval.py", line 20, in <module>
>     from gimpfu import *
>   File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
>     import gimp
> ImportError: could not import pygtk

You are probably missing the py-gtk2 package.

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

Ryan Boggs
On Sun, Sep 20, 2009 at 11:40:41PM +0200, Antoine Jacoutot wrote:

> On Sun, 20 Sep 2009, Buzzer wrote:
>
> > uname -a
> > OpenBSD localhost 4.5 200909202109#0 i386
> > sysctl -n kern.version
> > OpenBSD 4.5 (200909202109) #0: Sun Sep 20 22:18:12 2009
> >     root@localhost:/sys/arch/i386/compile/200909202109
> > pkg_info | grep -i gimp
> > gimp-2.6.4p0        GNU Image Manipulation Program
> > gimp-lqr-plugin-0.4.0.4 seam-carving smart rescale gimp plugin
> >
> > When I run GIMP, he always display these warnings:
> >
> > Traceback (most recent call last):
> >   File "/usr/local/lib/gimp/2.0/plug-ins/python-eval.py", line 20, in <module>
> >     from gimpfu import *
> >   File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
> >     import gimp
> > ImportError: could not import pygtk
>
> You are probably missing the py-gtk2 package.
>
> --
> Antoine
>
That would be odd since py-gtk2 is installed as a dependency for
gimp-stable, wouldn't it?  This problem shouldn't be occurring unless
there were problems during the install.  Unless I am missing something.

Thanks,
Ryan

Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

4625
In reply to this post by Antoine Jacoutot-7
On Sun, Sep 20, 2009 at 11:40:41PM +0200, Antoine Jacoutot wrote:

> > uname -a
> > OpenBSD localhost 4.5 200909202109#0 i386
> > sysctl -n kern.version
> > OpenBSD 4.5 (200909202109) #0: Sun Sep 20 22:18:12 2009
> >     root@localhost:/sys/arch/i386/compile/200909202109
> > pkg_info | grep -i gimp
> > gimp-2.6.4p0        GNU Image Manipulation Program
> > gimp-lqr-plugin-0.4.0.4 seam-carving smart rescale gimp plugin
> >
> > When I run GIMP, he always display these warnings:
> >
> > Traceback (most recent call last):
> >   File "/usr/local/lib/gimp/2.0/plug-ins/python-eval.py", line 20, in <module>
> >     from gimpfu import *
> >   File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
> >     import gimp
> > ImportError: could not import pygtk
>
> You are probably missing the py-gtk2 package.
pkg_info | grep -i py-gtk2
py-gtk2-2.12.1p2    GTK+2 Python bindings

--
/Buzzer


Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

Ryan Boggs
On Sun, Sep 20, 2009 at 04:25:59PM -0700, Buzzer wrote:

> On Sun, Sep 20, 2009 at 11:40:41PM +0200, Antoine Jacoutot wrote:
> > > uname -a
> > > OpenBSD localhost 4.5 200909202109#0 i386
> > > sysctl -n kern.version
> > > OpenBSD 4.5 (200909202109) #0: Sun Sep 20 22:18:12 2009
> > >     root@localhost:/sys/arch/i386/compile/200909202109
> > > pkg_info | grep -i gimp
> > > gimp-2.6.4p0        GNU Image Manipulation Program
> > > gimp-lqr-plugin-0.4.0.4 seam-carving smart rescale gimp plugin
> > >
> > > When I run GIMP, he always display these warnings:
> > >
> > > Traceback (most recent call last):
> > >   File "/usr/local/lib/gimp/2.0/plug-ins/python-eval.py", line 20, in <module>
> > >     from gimpfu import *
> > >   File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in <module>
> > >     import gimp
> > > ImportError: could not import pygtk
> >
> > You are probably missing the py-gtk2 package.
> pkg_info | grep -i py-gtk2
> py-gtk2-2.12.1p2    GTK+2 Python bindings
>
> --
> /Buzzer
>
>

Hey Buzzer,
Have you tried testing it through the interactive console?
Example:
$ python
>>> import pygtk

If this brings up an error after the import then something may be wrong
with your path settings.  I hope this helps.

Thanks,
Ryan

Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

4625
On Sun, Sep 20, 2009 at 10:47:20AM -0700, Ryan Boggs wrote:

> > > > uname -a
> > > > OpenBSD localhost 4.5 200909202109#0 i386
> > > > sysctl -n kern.version
> > > > OpenBSD 4.5 (200909202109) #0: Sun Sep 20 22:18:12 2009
> > > >     root@localhost:/sys/arch/i386/compile/200909202109
> > > > pkg_info | grep -i gimp
> > > > gimp-2.6.4p0        GNU Image Manipulation Program
> > > > gimp-lqr-plugin-0.4.0.4 seam-carving smart rescale gimp plugin
> > > >
> > > > When I run GIMP, he always display these warnings:
> > > >
> > > > Traceback (most recent call last):
> > > >   File "/usr/local/lib/gimp/2.0/plug-ins/python-eval.py", line 20,
> > > >     in <module> from gimpfu import *
> > > >   File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in
> > > >     <module> import gimp
> > > > ImportError: could not import pygtk
> > >
> > > You are probably missing the py-gtk2 package.
> > pkg_info | grep -i py-gtk2
> > py-gtk2-2.12.1p2    GTK+2 Python bindings
> >
> Hey Buzzer,
> Have you tried testing it through the interactive console?
> Example:
> $ python
> >>> import pygtk
>
echo ${PWD}
/tmp
$ python
Python 2.6.1 (r261:67515, Jul 11 2009, 02:21:18)
[GCC 3.3.5 (propolice)] on openbsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygtk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygtk
>>>

> If this brings up an error after the import then something may be wrong
> with your path settings.  I hope this helps.

$ pkg_info | grep -i py-gtk
py-gtk2-2.12.1p2    GTK+2 Python bindings

$ find / -type f -name "pygtk*"
/usr/local/bin/pygtk-codegen-2.0
/usr/local/bin/pygtk-demo
/usr/local/lib/pkgconfig/pygtk-2.0.pc
/usr/local/lib/python2.5/site-packages/pygtk.pth
/usr/local/lib/python2.5/site-packages/pygtk.py
/usr/local/lib/python2.5/site-packages/pygtk.pyc
/usr/local/lib/python2.5/site-packages/pygtk.pyo
/usr/local/lib/pygtk/2.0/pygtk-demo.py
/usr/local/lib/pygtk/2.0/pygtk-demo.pyc
/usr/local/lib/pygtk/2.0/pygtk-demo.pyo
/usr/local/include/pygtk-2.0/pygtk/pygtk.h

Attached 'info4inst_py-gtk.txt.gz' file may provide more info about
installed port 'py-gtk2'.

--
/Buzzer

info4inst_py-gtk.txt.gz (38K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

Jasper Lievisse Adriaanse-4
On Mon, Sep 21, 2009 at 01:57:02PM -0700, Buzzer wrote:

> On Sun, Sep 20, 2009 at 10:47:20AM -0700, Ryan Boggs wrote:
> > > > > uname -a
> > > > > OpenBSD localhost 4.5 200909202109#0 i386
> > > > > sysctl -n kern.version
> > > > > OpenBSD 4.5 (200909202109) #0: Sun Sep 20 22:18:12 2009
> > > > >     root@localhost:/sys/arch/i386/compile/200909202109
> > > > > pkg_info | grep -i gimp
> > > > > gimp-2.6.4p0        GNU Image Manipulation Program
> > > > > gimp-lqr-plugin-0.4.0.4 seam-carving smart rescale gimp plugin
> > > > >
> > > > > When I run GIMP, he always display these warnings:
> > > > >
> > > > > Traceback (most recent call last):
> > > > >   File "/usr/local/lib/gimp/2.0/plug-ins/python-eval.py", line 20,
> > > > >     in <module> from gimpfu import *
> > > > >   File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in
> > > > >     <module> import gimp
> > > > > ImportError: could not import pygtk
> > > >
> > > > You are probably missing the py-gtk2 package.
> > > pkg_info | grep -i py-gtk2
> > > py-gtk2-2.12.1p2    GTK+2 Python bindings
> > >
> > Hey Buzzer,
> > Have you tried testing it through the interactive console?
> > Example:
> > $ python
> > >>> import pygtk
> >
> echo ${PWD}
> /tmp
> $ python
> Python 2.6.1 (r261:67515, Jul 11 2009, 02:21:18)
^^^^^^^^^^^^^^^

your default python is 2.6....

> [GCC 3.3.5 (propolice)] on openbsd4
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import pygtk
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named pygtk
> >>>
>
> > If this brings up an error after the import then something may be wrong
> > with your path settings.  I hope this helps.
>
> $ pkg_info | grep -i py-gtk
> py-gtk2-2.12.1p2    GTK+2 Python bindings
>
> $ find / -type f -name "pygtk*"
> /usr/local/bin/pygtk-codegen-2.0
> /usr/local/bin/pygtk-demo
> /usr/local/lib/pkgconfig/pygtk-2.0.pc
> /usr/local/lib/python2.5/site-packages/pygtk.pth
> /usr/local/lib/python2.5/site-packages/pygtk.py
> /usr/local/lib/python2.5/site-packages/pygtk.pyc
> /usr/local/lib/python2.5/site-packages/pygtk.pyo
> /usr/local/lib/pygtk/2.0/pygtk-demo.py
> /usr/local/lib/pygtk/2.0/pygtk-demo.pyc
> /usr/local/lib/pygtk/2.0/pygtk-demo.pyo
> /usr/local/include/pygtk-2.0/pygtk/pygtk.h
>
> Attached 'info4inst_py-gtk.txt.gz' file may provide more info about
> installed port 'py-gtk2'.


...while you have py-gtk2 compiled for python 2.5.


> --
> /Buzzer



--
"Intelligence should guide our actions, but in harmony with the
  texture of the situation at hand"
        -- Francisco Varela

Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

4625
On Mon, Sep 21, 2009 at 11:07:46PM +0200, Jasper Lievisse Adriaanse wrote:

> > > > > > uname -a
> > > > > > OpenBSD localhost 4.5 200909202109#0 i386
> > > > > > sysctl -n kern.version
> > > > > > OpenBSD 4.5 (200909202109) #0: Sun Sep 20 22:18:12 2009
> > > > > >     root@localhost:/sys/arch/i386/compile/200909202109
> > > > > > pkg_info | grep -i gimp
> > > > > > gimp-2.6.4p0        GNU Image Manipulation Program
> > > > > > gimp-lqr-plugin-0.4.0.4 seam-carving smart rescale gimp plugin
> > > > > >
> > > > > > When I run GIMP, he always display these warnings:
> > > > > >
> > > > > > Traceback (most recent call last):
> > > > > >   File "/usr/local/lib/gimp/2.0/plug-ins/python-eval.py", line
> > > > > >     20, in <module> from gimpfu import *
> > > > > >   File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 75, in
> > > > > >     <module> import gimp
> > > > > > ImportError: could not import pygtk
> > > > >
> > > > > You are probably missing the py-gtk2 package.
> > > > pkg_info | grep -i py-gtk2
> > > > py-gtk2-2.12.1p2    GTK+2 Python bindings
> > > >
> > > Hey Buzzer,
> > > Have you tried testing it through the interactive console?
> > > Example:
> > > $ python
> > > >>> import pygtk
> > >
> > echo ${PWD}
> > /tmp
> > $ python
> > Python 2.6.1 (r261:67515, Jul 11 2009, 02:21:18)
> ^^^^^^^^^^^^^^^
>
> your default python is 2.6....
>
> > [GCC 3.3.5 (propolice)] on openbsd4
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import pygtk
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> > ImportError: No module named pygtk
> > >>>
> >
> > > If this brings up an error after the import then something may be wrong
> > > with your path settings.  I hope this helps.
> >
> ...while you have py-gtk2 compiled for python 2.5.

What is your solution?

--
/Buzzer


Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

Antoine Jacoutot-7
On Mon, 21 Sep 2009, Buzzer wrote:
> > ...while you have py-gtk2 compiled for python 2.5.
>
> What is your solution?

Make a link from /usr/local/bin/python2.5 to /usr/local/bin/python

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

4625
По данным радиоперехвата от 22-Sep-2009 00:58, Antoine Jacoutot
был замечен в эфире, на частоте 2009_read, с таким сообщением:

> > > ...while you have py-gtk2 compiled for python 2.5.
> >
> > What is your solution?
>
> Make a link from /usr/local/bin/python2.5 to /usr/local/bin/python

Do you to be aware that some other port previously installed may
require python 2.6? Should I then relink python, depending on what I'm
wanna to run right now!?

--
/Buzzer () кампания ascii ribbon - против писем в html формате
                /\ www.asciiribbon.org   - против проприетарных вложений


Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

Ryan Boggs
On Sat, Oct 03, 2009 at 01:30:18PM -0700, Buzzer wrote:

> ?? ?????? ?????????????? ?? 22-Sep-2009 00:58, Antoine Jacoutot
> ??? ??????? ? ?????, ?? ??????? 2009_read, ? ????? ??????????:
>
> > > > ...while you have py-gtk2 compiled for python 2.5.
> > >
> > > What is your solution?
> >
> > Make a link from /usr/local/bin/python2.5 to /usr/local/bin/python
>
> Do you to be aware that some other port previously installed may
> require python 2.6? Should I then relink python, depending on what I'm
> wanna to run right now!?
>
> --
> /Buzzer () ???????? ascii ribbon - ?????? ????? ? html ???????
> /\ www.asciiribbon.org   - ?????? ????????????? ????????
>
>

I don't know of any port within the ports tree that absolutely needs
version 2.6.  Almost, if not all, python ports in here should run fine
on 2.5.  I would suggest removing 2.6 and installing 2.5 so you won't
run into these problems.

If you absolutely need 2.6, unless I am mistaken you will need to use
ports instead of the packages to add the python modules.  Someone please
correct me if I am wrong.

Thanks,
Ryan

Reply | Threaded
Open this post in threaded view
|

Re: ImportError: could not import pygtk

Stuart Henderson
In reply to this post by 4625
On 2009/10/03 13:30, Buzzer wrote:

> ?? ?????? ?????????????? ?? 22-Sep-2009 00:58, Antoine Jacoutot
> ??? ??????? ? ?????, ?? ??????? 2009_read, ? ????? ??????????:
>
> > > > ...while you have py-gtk2 compiled for python 2.5.
> > >
> > > What is your solution?
> >
> > Make a link from /usr/local/bin/python2.5 to /usr/local/bin/python
>
> Do you to be aware that some other port previously installed may
> require python 2.6? Should I then relink python, depending on what I'm
> wanna to run right now!?

Ports should not rely on the /usr/local/bin/python link at all,
they should always edit scripts in-place to use the correct python
binary for whatever MODPY_VERSION was set to when the port was built.

This happens automatically for setuptools-based ports. Other
ports need to handle it themselves (or provide basic setuptools
infrastructure, there are a few examples in-tree e.g. ntlmaps).

If you notice something in ports which still needs the symlink
then mention it here or, better still, send diff.