Ubuntu Python -dbg packages

Terry Reedy tjreedy at udel.edu
Mon Jan 7 02:15:17 CET 2013


On 1/6/2013 3:21 PM, Lee Harr wrote:
>
>> On 1/6/2013 8:42 AM, Lee Harr wrote:
>>>
>>> I am using:
>>> Ubuntu 12.10
>>> Python 3.2.3
>>
>> import has been considerably redone, and hopefully upgraded, in 3.3.
>
>
> Ok, so now I tried python3.3-dbg but I don't think the pyqt
> modules are compiled for 3.3 and that may be preventing
> the import there.
>
> Those extension modules would need to be compiled for
> an exactly matching python interpreter, right?

For Windows visual C compiler, that is true. I do not know about gcc on 
*nix. I have gotten the impression that it is not necessarily so, except 
as the C api has changed in a way that affects the extension library. 
(Given that 3.3 is 3 months old, after 6 months of alpha/beta releases, 
and has some major improvements, it is past time for libraries that need 
recompiling to be so.)

>>> I also have the ubuntu -dbg packages:
>>> python3-dbg
>>> python3-pyqt4-dbg

>>> I don't understand why python3-dbg cannot import the PyQt4 modules...
>
>> Is PyQtr.__file__ the same here, as below?
>
> Yes. It's the same.
>
> Sorry, that's what I meant to show there.
>
> $ python3
> Python 3.2.3 (default, Oct 19 2012, 19:53:57)
> [GCC 4.7.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import PyQt4
>>>> PyQt4.__file__
> '/usr/lib/python3/dist-packages/PyQt4/__init__.py'
>>>>
>
>
>
>>> $ python3-dbg
>>> Python 3.2.3 (default, Oct 19 2012, 19:58:54)
>>> [GCC 4.7.2] on linux2

>>>>>> import PyQt4
>>> [60323 refs]
>>>>>> PyQt4.__file__
>>> '/usr/lib/python3/dist-packages/PyQt4/__init__.py'
>>> [60323 refs]
>>>>>> import PyQt4.QtCore
>>> Traceback (most recent call last):
>>>      File "<stdin>", line 1, in <module>
>>> ImportError: No module named QtCore
>>> [150996 refs]

> So, python3-dbg _should_ be able to import this?

Given that python3 and python3-dbg import the same PyQt4 file, and that 
you spell PyQt4.QtCore the same (I checked), I am as surprised as you. 
Perhaps there is a bug in the import of the dbg build finding modules in 
packages, but that is so basic, that would surprise me also. Try running 
test/test_imp, _import, _importhooks, _importlib with both binaries 
(because you are looking for a different).

On Windows, with 3.3, interactively in IDLE, I get
 >>> import test.test_imp as t; t.test_main()
...
Ran 29 tests in 0.134s
OK (skipped=1)
...
Ran 48 tests in 0.953s
OK (skipped=4)
...
Ran 4 tests in 0.169s
OK
...
Ran 288 tests in 1.684s
OK (skipped=2)

Note that the above invocation runs in verbose mode, so if there is a 
difference, you can find the specific test. The skips are usually system 
specific. For instance, the one skip in the first batch is

test_issue5604 (test.test_imp.ImportTests) ... skipped "can't run this 
test with mbcs as filesystem encoding"

The others were for other posix-windows differences.

> Any ideas about the python3-pyqt4-dbg modules mentioned originally?

No. I stuck to what looked like might be easier.

-- 
Terry Jan Reedy




More information about the Python-list mailing list