×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    285

    Where to place python library

    Hi

    My application has a dynamic link library (called temp.pyd, say). It runs properly on the phone, when I use ensymble to install the library in the c:/sys folder on the phone.

    I am trying to run the same code on the emulator and want to know where to place the temp.pyd file in the computer. I placed the temp.pyd file in sys/bin/ folder and opened the interactive console and typed
    Code:
    >>import temp
    Traceback (most recent call):
    File "<console>", line 1, in ?
    File C:\resource\site.py",line 109, in plastsec_import
    return imp.load_dynamic(name,name+'.pyd')
    SymbianError: [Errno -5]
    KErrNotSupported
    However, the library does not get imported. All the other libraries in the folder (such as e32db.pyd and e32socket.pyd) get imported (ie import e32socket) without giving any error.

    Is there some special way to install it? Or some file where all installed libraries get listed, where I need to make changes?

    I want to test an application on the emulator, where the library plays a crucial role. I cannot keep installing the application on the phone.

    Thanks for the help.

    Kedar

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

    Re: Where to place python library

    hello Kedar


    try using this
    Code:
    import sys
    sys.path.append("path of your library")
    import yourlib
    I hope this works for you.

    Regards,

  3. #3
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    285

    Re: Where to place python library

    Hi!

    I tried exactly what you said -

    Code:
    >>import sys
    >> sys.path.append("c:/sys/bin/")
    >> import temp
    Traceback (most recent call):
    File "<console>", line 1, in ?
    File C:\resource\site.py",line 109, in plastsec_import
    return_original_import(name,globals,locals,fromlist)
    SymbianError: [Errno -5]
    KErrNotSupported
    Somethings that struck me (please correct me) -
    1. The 'sys.path.append' seems to be correct (by default), as all the other libraries (pyd files) in the folder c:/sys/bin can be imported without any problems.
    2. I tried the address field with both - '\' and '/'
    3. I tried giving the absolute address of the windows machine (ie C:\Symbian\9.1\S60_3rd_ed_MR\Epoch32\winscw\c\sys\bin)

    All these attempts threw out some error or the other.

    The same pyd file works perfectly fine on the phone. I do not have the source code to the pyd, so I cannot really change anything in the way it works. I extracted the pyd from the app and am trying to use it with the emulator (is this causing the problem?)

    Thanks
    Kedar

  4. #4
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Where to place python library

    Quote Originally Posted by kedarm View Post
    Hi
    Is there some special way to install it? Or some file where all installed libraries get listed, where I need to make changes?
    You have to recompile the pyd file under Emulator Debug build to test it on emulator & it is always recommended to create a Python C++ stub to load dlls i.e a py script which is placed in resource/python25 (or resource/ folder in pys60 1.4.x case) and use to load the pyd from the sys/bin directory. Please, read this post carefully. it will surely helps u.
    http://discussion.forum.nokia.com/fo...54&postcount=5

    Best Regards,
    SajiSoft

Similar Threads

  1. Do not get response in movino-symbian application.
    By SymbianTH in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2009-09-17, 10:09
  2. Error loading connection when obfuscation high?
    By ejakkk in forum Mobile Java General
    Replies: 8
    Last Post: 2009-06-26, 12:54
  3. Not found Mif & BMP
    By mockba in forum Symbian
    Replies: 7
    Last Post: 2008-09-11, 07:31
  4. SOAP Library for Python
    By venkatt_shankar in forum Symbian
    Replies: 0
    Last Post: 2007-05-14, 18:35
  5. Python Library Module Support
    By Rudiger2 in forum Symbian
    Replies: 4
    Last Post: 2006-08-09, 04:59

Posting Permissions

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