Re: [pygtk] Python does not find PyGtk

2003-01-06 Thread Martijn Brouwer
On Mon, 06 Jan 2003 10:54:12 +0800
James Henstridge [EMAIL PROTECTED] wrote:

 Martijn Brouwer wrote:
 
 That was what I understood from the faq too, however it seems that 1.99 requires 
importation of pygtk before gtk even when only one version of pygtk is installed.
 I have python 2.2 with gnome-python 1.99.13. On my system (debian testing) 
gnome-python 1.4 based on pygtk 0.69.3 is installed in combination with python 2.1. 
(in python2.1/site-packages)
   
 
 This might be an artefact of the debian packaging.  It works fine 
 compiled from tarballs (and on other distros).

PyGtk 199.13 is from a tarball. But it works now, I am exploring the possibilities, so 
I do not complain anymore. Perhaps it is an idea to make things a little more 
transparent, as already suggested by other people on this list.

Bye,

Martijn
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Python does not find PyGtk

2003-01-05 Thread James Henstridge
Martijn Brouwer wrote:


I have two versions of python installed (2.1 and 2.2) on a linux system running debian testing. For 2.1 I have PyGtk installed using the packages from the distribution, which works fine. Now I want to write a program myself using PyGtk and Gnome-Python version 1.99.13. Both are now installed in /home/martijn/sys/lib/python2.2/sitepackages. The listing of this directory looks like everything is OK.
drwxr-xr-x5 martijn  users4096 Dec 27 16:08 gtk-2.0
-rw-r--r--1 martijn  users   8 Dec 26 23:12 pygtk.pth
-rw-r--r--1 martijn  users2092 Dec 26 23:12 pygtk.py
-rw-r--r--1 martijn  users1841 Dec 26 23:12 pygtk.pyc
-rw-r--r--1 martijn  users1504 Dec 26 23:12 pygtk.pyo

Yet, when I export PYTHONPATH=/home/martijn/sys/lib/python2.2/sitepackages and start the python interpreter (2.2) I cannot import gtk: 
ImportError: No module named gtk
 

If you didn't install pygtk into the same prefix as python, you should 
add pythonX.Y/site-packages/gtk-2.0 to the python path as well as 
pythonX.Y/site-packages.  Python only performs the .pth file parsing 
for what it considers site directories, which doesn't count things 
pulled in from PYTHONPATH.

James.

--
Email: [EMAIL PROTECTED]  | Linux.conf.au   http://linux.conf.au/
WWW:   http://www.daa.com.au/~james/ | Jan 22-25   Perth, Western Australia. 



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Python does not find PyGtk

2003-01-05 Thread James Henstridge
Martijn Brouwer wrote:


That was what I understood from the faq too, however it seems that 1.99 requires importation of pygtk before gtk even when only one version of pygtk is installed.
I have python 2.2 with gnome-python 1.99.13. On my system (debian testing) gnome-python 1.4 based on pygtk 0.69.3 is installed in combination with python 2.1. (in python2.1/site-packages)
 

This might be an artefact of the debian packaging.  It works fine 
compiled from tarballs (and on other distros).

James.

--
Email: [EMAIL PROTECTED]  | Linux.conf.au   http://linux.conf.au/
WWW:   http://www.daa.com.au/~james/ | Jan 22-25   Perth, Western Australia. 



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Python does not find PyGtk

2003-01-02 Thread Christian Reis

So, is import pygtk required or not for pygtk2?

On Tue, Dec 31, 2002 at 04:25:41PM +0100, Martijn Brouwer wrote:
 That was what I understood from the faq too, however it seems that 1.99 requires 
importation of pygtk before gtk even when only one version of pygtk is installed.
 I have python 2.2 with gnome-python 1.99.13. On my system (debian testing) 
gnome-python 1.4 based on pygtk 0.69.3 is installed in combination with python 2.1. 
(in python2.1/site-packages)
 
 On Sun, 29 Dec 2002 15:55:04 -0800
 John Finlay [EMAIL PROTECTED] wrote:
 
  My understanding is that this is only required if you have both PyGTK 
  0.6.11 and  PyGTK 1.99.13 installed together.
  Are there other circumstances where this is required?
  
  Thanks
  
  john
  
  Martijn Brouwer wrote:
  
  On Sat, 28 Dec 2002 23:18:30 +0100
  Tom Cato Amundsen [EMAIL PROTECTED] wrote:
  

  
  ImportError: No module named gtk
  

  
  I guess you forgot to
  import pygtk
  pygtk.require(2.0)
  
  before import gtk
  
  
  
  No I did not forget it, I just did not know I had to. :) Now I read something 
about it in a section of the faq I skipped because I was not upgrading from an 
earlier version. This issue is not in John Finlay's tutorial though allthough the 
tutorial is dated from 1 december. I will drop him a kind notice.
  
  Thanks for your help!
  
  Martijn
  ___
  pygtk mailing list   [EMAIL PROTECTED]
  http://www.daa.com.au/mailman/listinfo/pygtk
  Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

  
  
  
 ___
 pygtk mailing list   [EMAIL PROTECTED]
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Python does not find PyGtk

2003-01-02 Thread Christian Reis
On Thu, Jan 02, 2003 at 12:11:28PM -0200, Johan Dahlin wrote:
 tor 2003-01-02 klockan 11.53 skrev Christian Reis:
  So, is import pygtk required or not for pygtk2?
 
 It depends.
 
 1) Where python is installed
 2) How pygtk.pth looks like

I've added this as FAQ 2.6. What follows is MHO:

The sheer complexity of the description is a good reason to suggest that
anybody *considering* using a scheme like this to manage versions in
their Python packages to ** steer clear of using .pth  files ** - it's
overly complex, error-prone, and didn't get us anything apart from
preserving the gtk namespace. For the particularly brave:

http://www.async.com.br/faq/pygtk/index.py?req=showfile=faq02.006.htp

If anybody has a simpler version of the test script I've put there, I'd
like to add it to the FAQ, thanks.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Python does not find PyGtk

2003-01-02 Thread John Finlay




As a datapoint, I have a RH7.2 system which has python 1.5.2, GTK 1.2 and
pygtk 0.6.6 installed in /usr. I installed python 2.2.2, GTK 2.0.6 and pygtk
1.99.13 in /usr/local.

/usr/local/bin/python can use import gtk to get 1.99.13 since there is no
pygtk 0.6.x - import pygtk also works

/usr/bin/python can use import gtk to get 0.6.6

John

Johan Dahlin wrote:

  tor 2003-01-02 klockan 11.53 skrev Christian Reis:
  
  
So, is import pygtk required or not for pygtk2?

  
  
It depends.

1) Where python is installed
2) How pygtk.pth looks like

If python is installed in a site dir, /usr or /usr/local (not in /opt or
/usr/local/pygtk), pygtk.pth is processed.

If pygtk.pth is processed the content of this file is added to sys.path.
For example, if it says gtk-2.0 and is in
/usr/local/lib/python2.2/site-packages, .../site-packages/gtk-2.0 will
be added to sys.path.

For example, if pygtk 0.6.x where x is higher than 11 is installed on a
Red Hat 8.0 system, which provides 1.99.12 we have the following
scenario:

import gtk- pygtk 1.99.12

import pygtk
pygtk.require('1.2') 
import gtk- pygtk 0.6.x

import pygtk
pygtk.require('2.0') 
import gtk- pygtk 1.99.12

As you can see pygtk is required for 0.6.x, but not for 1.99.12, since 

On a old system with 0.6.x as default, Red Hat 7.x for example, it's the
opposite import gtk - 0.6.x and import pygtk;pygtk.require is required
for 1.99.x (which is installed by the user)

  






Re: [pygtk] Python does not find PyGtk

2002-12-31 Thread Martijn Brouwer
That was what I understood from the faq too, however it seems that 1.99 requires 
importation of pygtk before gtk even when only one version of pygtk is installed.
I have python 2.2 with gnome-python 1.99.13. On my system (debian testing) 
gnome-python 1.4 based on pygtk 0.69.3 is installed in combination with python 2.1. 
(in python2.1/site-packages)

On Sun, 29 Dec 2002 15:55:04 -0800
John Finlay [EMAIL PROTECTED] wrote:

 My understanding is that this is only required if you have both PyGTK 
 0.6.11 and  PyGTK 1.99.13 installed together.
 Are there other circumstances where this is required?
 
 Thanks
 
 john
 
 Martijn Brouwer wrote:
 
 On Sat, 28 Dec 2002 23:18:30 +0100
 Tom Cato Amundsen [EMAIL PROTECTED] wrote:
 
   
 
 ImportError: No module named gtk
 
   
 
 I guess you forgot to
 import pygtk
 pygtk.require(2.0)
 
 before import gtk
 
 
 
 No I did not forget it, I just did not know I had to. :) Now I read something about 
it in a section of the faq I skipped because I was not upgrading from an earlier 
version. This issue is not in John Finlay's tutorial though allthough the tutorial is 
dated from 1 december. I will drop him a kind notice.
 
 Thanks for your help!
 
 Martijn
 ___
 pygtk mailing list   [EMAIL PROTECTED]
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
   
 
 
 
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Python does not find PyGtk

2002-12-29 Thread Martijn Brouwer
On Sat, 28 Dec 2002 23:18:30 +0100
Tom Cato Amundsen [EMAIL PROTECTED] wrote:

  ImportError: No module named gtk
  
 I guess you forgot to
 import pygtk
 pygtk.require(2.0)
 
 before import gtk

No I did not forget it, I just did not know I had to. :) Now I read something about it 
in a section of the faq I skipped because I was not upgrading from an earlier version. 
This issue is not in John Finlay's tutorial though allthough the tutorial is dated 
from 1 december. I will drop him a kind notice.

Thanks for your help!

Martijn
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Python does not find PyGtk

2002-12-29 Thread John Finlay




My understanding is that this is only required if you have both PyGTK 0.6.11
and  PyGTK 1.99.13 installed together.
Are there other circumstances where this is required?

Thanks

john

Martijn Brouwer wrote:

  On Sat, 28 Dec 2002 23:18:30 +0100
Tom Cato Amundsen [EMAIL PROTECTED] wrote:

  
  

  ImportError: No module named gtk

  

I guess you forgot to
import pygtk
pygtk.require("2.0")

before "import gtk"

  
  
No I did not forget it, I just did not know I had to. :) Now I read something about it in a section of the faq I skipped because I was not upgrading from an earlier version. This issue is not in John Finlay's tutorial though allthough the tutorial is dated from 1 december. I will drop him a kind notice.

Thanks for your help!

Martijn
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
  






[pygtk] Python does not find PyGtk

2002-12-28 Thread Martijn Brouwer
I have two versions of python installed (2.1 and 2.2) on a linux system running debian 
testing. For 2.1 I have PyGtk installed using the packages from the distribution, 
which works fine. Now I want to write a program myself using PyGtk and Gnome-Python 
version 1.99.13. Both are now installed in 
/home/martijn/sys/lib/python2.2/sitepackages. The listing of this directory looks like 
everything is OK.
drwxr-xr-x5 martijn  users4096 Dec 27 16:08 gtk-2.0
-rw-r--r--1 martijn  users   8 Dec 26 23:12 pygtk.pth
-rw-r--r--1 martijn  users2092 Dec 26 23:12 pygtk.py
-rw-r--r--1 martijn  users1841 Dec 26 23:12 pygtk.pyc
-rw-r--r--1 martijn  users1504 Dec 26 23:12 pygtk.pyo

Yet, when I export PYTHONPATH=/home/martijn/sys/lib/python2.2/sitepackages and start 
the python interpreter (2.2) I cannot import gtk: 
ImportError: No module named gtk

What is missing? sys.path is
['', '/home/martijn/sys/lib/python2.2/site-packages', '/usr/lib/python2.2', 
'/usr/lib/python2.2/plat-linux2', '/usr/lib/python2.2/lib-tk', 
'/usr/lib/python2.2/lib-dynload', '/usr/local/lib/python2.2/site-packages', 
'/usr/lib/python2.2/site-packages', '/usr/lib/python2.2/site-packages/Numeric', 
'/usr/lib/site-python']

What is missing. I would really like to run the helloworld program from the tutorial 
;-)

Thanks for helping

Martijn

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Python does not find PyGtk

2002-12-28 Thread Tom Cato Amundsen
On Sat, Dec 28, 2002 at 10:50:32PM +0100, Martijn Brouwer wrote:
 I have two versions of python installed (2.1 and 2.2) on a linux system running 
debian testing. For 2.1 I have PyGtk installed using the packages from the 
distribution, which works fine. Now I want to write a program myself using PyGtk and 
Gnome-Python version 1.99.13. Both are now installed in 
/home/martijn/sys/lib/python2.2/sitepackages. The listing of this directory looks 
like everything is OK.
 drwxr-xr-x5 martijn  users4096 Dec 27 16:08 gtk-2.0
 -rw-r--r--1 martijn  users   8 Dec 26 23:12 pygtk.pth
 -rw-r--r--1 martijn  users2092 Dec 26 23:12 pygtk.py
 -rw-r--r--1 martijn  users1841 Dec 26 23:12 pygtk.pyc
 -rw-r--r--1 martijn  users1504 Dec 26 23:12 pygtk.pyo
 
 Yet, when I export PYTHONPATH=/home/martijn/sys/lib/python2.2/sitepackages and start 
the python interpreter (2.2) I cannot import gtk: 
   
You mean
site-packages,
   right?

 ImportError: No module named gtk
 
 What is missing? sys.path is

I guess you forgot to

import pygtk
pygtk.require(2.0)

before import gtk



-- 
Tom Cato Amundsen [EMAIL PROTECTED]
GNU Solfege - free eartraining, http://www.gnu.org/software/solfege/
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/