×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    ImportError:dlopen:Load failed

    Hi

    I attached my application code please help me why comes this error.

    I tested in 3rd edition FP1(Nokia E71x) on following way:

    1. Open manually c:\resource folder copy paste example.py file into c:\data\python\ folder.

    2. Open Pyys60 1.9.4 -> RunScript -> click on "example.py" "Gives me Error"

    3. Go "Interactive Module" write
    dir()
    dir(imp)
    dir(imp.load_dynamic)
    imp.load_dynamic('example','sys\\bin\\example.pyd')
    and also tried imp.load_dynamic('example','c:\\resource\\example.pyd')

    But always comes Error: "ImportError:dlopen:Load failed"

    Please Help me.

    Regards
    SymbianTH
    Attached Files Attached Files

  2. #2
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: ImportError:dlopen:Load failed

    Hi

    If anybody see code.

    Code:
    example.cpp
    -----------
    #include "Python.h"
    #include "symbian_python_ext_util.h"
    
    
    static PyObject* example_foo(PyObject *self, PyObject *args) {
    	char buf[50];                          // create a buffer that's long enough
    	sprintf(buf, "Hello World");           // fill it with text (stuff like %d would be possible as well)
    	return PyString_FromString(buf);       // return the Python object containing our string
    }
    
    static PyMethodDef example_methods[] = {
    	{"foo", example_foo, METH_VARARGS, "description for foo()"},
    	{NULL, NULL}
    };
    
    DL_EXPORT(void) initexample(void) {
    	Py_InitModule("example", example_methods);
    }
    
    #ifndef EKA2
    GLDEF_C TInt E32Dll(TDllReason)
    {
      return KErrNone;
    }
    #endif
    
    example.pkg
    -------------
    #{"example DLL"},(0xEC3E4C03),1,0,0
    
    
    ;Localised Vendor name
    %{"Embedded Systems Lab"}
    
    ;Unique Vendor name
    :"ESL"
    
    "C:\Symbian\Code\PYTHON\example\example.py"-"c:\data\python\example.py"
    "C:\Symbian\9.2\S60_3rd_FP1_4\Epoc32\release\gcce\urel\kf_example.pyd" -"c:\sys\bin\kf_example.pyd"
    
    
    
    example.mmp
    -----------
    TARGETTYPE	dll
    UID			 0x1000008d 0xEC3E4C03
    TARGET		kf_example.pyd
    TARGETPATH	\system\libs
    
    #ifdef EKA2
    CAPABILITY  NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment
    #endif
    
    NOSTRICTDEF
    EXPORTUNFROZEN
    
    SYSTEMINCLUDE 	\epoc32\include
    SYSTEMINCLUDE 	\epoc32\include\libc
    SYSTEMINCLUDE   \epoc32\include\python
    
    LIBRARY 	python222.lib
    LIBRARY 	euser.lib
    LIBRARY   avkon.lib
    LIBRARY   eikcdlg.lib
    LIBRARY   eikctl.lib
    LIBRARY   estlib.lib /* Necessary only if you use the C standard library */
    
    #ifdef ENABLE_ABIV2_MODE
    DEBUGGABLE_UDEBONLY
    #endif
    //MACRO __DO_LOGGING__
    
    SOURCE example.cpp
    Code:
    example.py
    -----------
    
    import e32
    
    if e32.s60_version_info>=(3,0):
        import imp
        example=imp.load_dynamic('example', 'c:\\sys\\bin\\kf_example.pyd')
        
    else:
        import example
    
    del e32, imp #remove unnecessary names from namespace
    from example import *
    del example
    Regards,
    SymbianTH

Similar Threads

  1. HelloWorldBasic's Issue
    By bluescorpio1107 in forum Symbian
    Replies: 4
    Last Post: 2009-09-04, 14:41
  2. S60 5th ed emulator startup failed
    By hony in forum Symbian Tools & SDKs
    Replies: 8
    Last Post: 2009-08-11, 21:12
  3. S60 2nd to 3rd/ PlatformSecurity / Capabilities
    By jarkoos in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 4
    Last Post: 2007-04-14, 14:08
  4. ERROR: RCMake failed: (Bitmaps): bmconv.exe failed with code 5
    By Dexterp37 in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2005-09-07, 08:53
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

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