Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > import module doesn't work for new package

Reply
Thread Tools

import module doesn't work for new package

 
 
goldtech
Guest
Posts: n/a
 
      12-03-2010
I tried install a Python - would the word be "package"? - on Ubuntu
10.10. Could you tell me how to fix? I would be grateful, is it a path
problem? Thanks. Lee

giga1@giga1:~/Desktop/pykhtml-0.2$ sudo python setup.py install
[sudo] password for giga1:
running install
running build
running build_py
creating build
creating build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/pykhtml
copying pykhtml/dom.py -> build/lib.linux-i686-2.6/pykhtml
copying pykhtml/__init__.py -> build/lib.linux-i686-2.6/pykhtml
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.6/dist-packages/PyKHTML-0.2.egg-info
Writing /usr/local/lib/python2.6/dist-packages/PyKHTML-0.2.egg-info

then:

>>> import pykhtml

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pykhtml/__init__.py", line 3, in <module>
import khtml, kdecore, kdeui, kio, dcopext
ImportError: No module named khtml
 
Reply With Quote
 
 
 
 
Steven D'Aprano
Guest
Posts: n/a
 
      12-04-2010
On Fri, 03 Dec 2010 12:27:04 -0800, goldtech wrote:

> I tried install a Python - would the word be "package"? - on Ubuntu
> 10.10. Could you tell me how to fix? I would be grateful, is it a path
> problem? Thanks. Lee


That looks to me like either a missing dependency, or a bug in the
package.

It could be that package pykhtml depends on another package khtml, which
isn't installed, or it could simply be a bug in pykhtml.

It might help if you look at the MANIFEST file that came with the pykhtml
package, and see what files it lists.


--
Steven
 
Reply With Quote
 
 
 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      12-04-2010
On Fri, 3 Dec 2010 12:27:04 -0800 (PST), goldtech
<(E-Mail Removed)> declaimed the following in
gmane.comp.python.general:

> import khtml, kdecore, kdeui, kio, dcopext
> ImportError: No module named khtml


Given those names this package is targeted for use with the KDE
windowing system... Is that what you are running?
--
Wulfraed Dennis Lee Bieber AF6VN
http://www.velocityreviews.com/forums/(E-Mail Removed) HTTP://wlfraed.home.netcom.com/

 
Reply With Quote
 
Peter Otten
Guest
Posts: n/a
 
      12-04-2010
goldtech wrote:

> I tried install a Python - would the word be "package"? - on Ubuntu
> 10.10. Could you tell me how to fix? I would be grateful, is it a path
> problem? Thanks. Lee


If you are talking about http://paul.giannaros.org/pykhtml/ , this package
requires kde3 while you are /probably/ running kde4.

> giga1@giga1:~/Desktop/pykhtml-0.2$ sudo python setup.py install
> [sudo] password for giga1:
> running install
> running build
> running build_py
> creating build
> creating build/lib.linux-i686-2.6
> creating build/lib.linux-i686-2.6/pykhtml
> copying pykhtml/dom.py -> build/lib.linux-i686-2.6/pykhtml
> copying pykhtml/__init__.py -> build/lib.linux-i686-2.6/pykhtml
> running install_lib
> running install_egg_info
> Removing /usr/local/lib/python2.6/dist-packages/PyKHTML-0.2.egg-info
> Writing /usr/local/lib/python2.6/dist-packages/PyKHTML-0.2.egg-info
>
> then:
>
>>>> import pykhtml

> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "pykhtml/__init__.py", line 3, in <module>
> import khtml, kdecore, kdeui, kio, dcopext
> ImportError: No module named khtml


This would become

from PyKDE4 import khtml, kdecore, kdeui, kio

in KDE4, but there are /probably/ API changes. DCOP which is /probably/ what
dcopext provides has been replaced with dbus.

Given these changes and the fact that pykhtml development has stopped in
early 2008 you'd /probably/ have to put in a lot of effort to make it work
with your current desktop environment.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why 'import module' will not import module.py but the directorymodule? Peng Yu Python 0 10-31-2009 11:51 PM
The difference between "import package.module" and "from packageimport module"(about pymol) Xiao Jianfeng Python 2 12-16-2005 08:20 AM
Handling import conflicts when module has the same name as a library module that it needs to import? plb Python 0 02-08-2005 01:08 PM
Handling import conflicts when module has the same name as a library module that it needs to import? plb Python 0 02-08-2005 01:01 PM
package module import name clash with global package George P Python 3 09-11-2004 01:19 PM



Advertisments