×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    packaging python 1.9.6 extension

    Hello, guys

    I've already spent days on the same small issue, which I can't find out to deal with but which is quite simple at the same time: how do I package sis file for 1.9.x so that it works?

    Basically, I need to be able to export it as a library. I've tried a few ways of doing it: packaging it using carbide c++, using ensymble, putting under module-repo and then using ensymble... Sometimes I mange to install the extension successfully (without errors), but importing the library is still not possible.

    The project is made of .py files and a single .pyd (compiled from c++). What directories they need to be written to on the phone to be able to use it?

    Thanks.

  2. #2
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Re: packaging python 1.9.6 extension

    OK, I managed to make some progress myself - I can now import .py libraries, but not the .pyd.

    So a very short and simple question: where do I put the pyd file?
    \system\libs - doesn't work (can't find module)
    \sys\bin - can't install

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: packaging python 1.9.6 extension

    Quote Originally Posted by AndriusA View Post
    OK, I managed to make some progress myself - I can now import .py libraries, but not the .pyd.

    So a very short and simple question: where do I put the pyd file?
    \system\libs - doesn't work (can't find module)
    \sys\bin - can't install
    hello andriusA

    put the pyd file where ever you want and import that using the following code:
    Code:
    import sys
    sys.path.append("Directory where you put your pyd file")
    in your script which you are using.

    Hope i got you correctly.

  4. #4
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Re: packaging python 1.9.6 extension

    Hi gaba88

    Quote Originally Posted by gaba88 View Post

    put the pyd file where ever you want and import that using the following code:
    Code:
    import sys
    sys.path.append("Directory where you put your pyd file")
    in your script which you are using.

    Hope i got you correctly.
    Not really.. For some reason just putting the file let's say to "e:\Python\lib" (and appending it to the sys.path) does not work. Also, what about all those prefixes kf_ (251_ for pre-1.9.x versions)? Also, I'm pretty sure it was said somewhere, that you can't use pyd files just like this, so I decided to pack them in a sis file and install, but not yet luckily..

    Thanks

  5. #5
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    114

    Re: packaging python 1.9.6 extension

    Quote Originally Posted by AndriusA View Post
    OK, I managed to make some progress myself - I can now import .py libraries, but not the .pyd.

    So a very short and simple question: where do I put the pyd file?
    \system\libs - doesn't work (can't find module)
    \sys\bin - can't install
    You cannot load a PYD from anywhere other than \sys\bin. Rename your PYD to kf_<modulename> and place it in a directory of its own under \dev-modules. For eg. if your extension module name is 'foo' then rename the PYD to kf_foo and place this PYD in the folder \dev-modules\foo. Use 'import foo' in your application script.

    When you package your script(which imports this PYD) using PyS60 application packager, it will automatically pick up the PYD and package it along with the application sis.

    You can read up more about the Module repository in the documentation - Chapter 7
    import antigravity

  6. #6
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Re: packaging python 1.9.6 extension

    Thanks a lot, it seems to work now. The strange thing, however, is that I've tried to do it this way before, but it didn't work. Anyway, must have done something wrong somewhere else.

    Also, having librararies all around the place is not very nice, I'd prefer having them where my application actually is, but at least it works this way.

    Thanks.

Similar Threads

  1. Python for S60 1.9.6 released
    By tvijayan in forum Python
    Replies: 27
    Last Post: 2009-07-19, 15:52
  2. Python for S60 1.9.5 is now released
    By tvijayan in forum Python
    Replies: 8
    Last Post: 2009-05-30, 05:33
  3. Python for S60 1.9.3 released
    By tvijayan in forum Python
    Replies: 40
    Last Post: 2009-04-03, 15:00
  4. Python for S60 1.9.2 released
    By tvijayan in forum Python
    Replies: 26
    Last Post: 2009-03-11, 09:28
  5. Python for S60 1.9.0 released
    By tvijayan in forum Python
    Replies: 48
    Last Post: 2009-01-27, 15:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •