This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[ubuntu 10.04] kross "hello world" example not working

Tags: None
(comma "," separated)
naitsirhc
Registered Member
Posts
2
Karma
0
Hello,

I'm trying to run the "hello world" example kross script from:
http://ktorrent.org/wiki/index.php/Writing_Scripts

My system is:

Ubuntu 10.04
KTorrent 3.3.4
Kross:
    Qt: 4.6.2
    KDE Development Platform: 4.4.2 (KDE 4.4.2)
    Kross: 0.1
I have installed both krosspython and libkrosspython0. However, when I try to run the hello world script, I get the following output:

Code: Select all
Kross: "Loading the interpreter library for python"
Kross: "Successfully loaded Interpreter instance from library."
Kross: "PythonScript::Constructor."
Kross: "PythonScript::execute"
Kross: "PythonInterpreter::extractException:
  File "hello_world.py", line 3, in <module>
    import KTorrent

  File "<string>", line 20, in _import
"
Kross: "Error error=No module named KTorrent lineno=20 trace=
  File "hello_world.py", line 3, in <module>
    import KTorrent

  File "<string>", line 20, in _import
"
ImportError: No module named KTorrent
Kross: "PythonScript::Destructor."
No module named KTorrent
  File "hello_world.py", line 3, in <module>
    import KTorrent

  File "<string>", line 20, in _import


It seems that the KTorrent module cannot be found.

Does anyone have any suggestions?

Cheers,
Christian
George
Moderator
Posts
5421
Karma
1
You are running this from inside the scripting plugin ?
naitsirhc
Registered Member
Posts
2
Karma
0
No, I am trying to run this from the command-line using:

$kross hello_world.py

I'd like to be able to run from the command-line for debugging purposes before running from the scripting plugin. Is this possible? Do I need to specify some paths/parameters to kross?

Thanks for your help!
George
Moderator
Posts
5421
Karma
1
You can't do that, the scripting plugin loads several modules which are not loaded by the kross commandline tool. So obviously you get these errors.

And making them loadable from the kross commandline (if that's possible), would also not make sense, because these modules need the rest of ktorrent to function properly.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]