×

Discussion Board

Results 1 to 11 of 11

Thread: ImportError

  1. #1
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    54

    ImportError

    Hi
    I've a problem with the module appswitch, when a i try to start my app he give this error:

    Code:
    ImportError: No module named appswitch

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: ImportError

    This may sound silly, but I have to ask: did you install appswitch first, or did you just try to import it as a built-in module?

    If you didn't install it, go here and download it and then install it on the phone.

  3. #3
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    54

    Re: ImportError

    How can i install it on phone?

    I've tried with this code:

    Code:
    import e32
    
    import appswitch
    
    apps = appswitch.application_list(True) # true = include all
                                           # false = no hidden apps
    print apps
    for app in apps:
        print appswitch.switch_to_fg(app)    
        e32.ao_sleep(1)

  4. #4
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: ImportError

    appswitch is not a module that comes with Python, like e32, appuifw etc. It is a third party one (made by Cyke64) that you have to install before using it. To install it, download the .sis (or .sisx) installation package, transfer it to the phone and install it.
    It will be installed in C:\\sys\\bin\\. Write this in your code before importing appswitch to tell Python where to look for the module:
    Code:
    import sys
    
    sys.path.append('C:\\sys\\bin\\')
    So in the end your code should be like this:
    Code:
    import e32
    
    import sys
    sys.path.append('C:\\sys\\bin\\')
    
    import appswitch
    
    apps = appswitch.application_list(True) # true = include all
                                           # false = no hidden apps
    print apps
    for app in apps:
        print appswitch.switch_to_fg(app)    
        e32.ao_sleep(1)
    Last edited by bogdan.galiceanu; 2008-04-11 at 14:41.

  5. #5
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    54

    Re: ImportError

    Where can i found the sis file?
    In this site http://cyke64.googlepages.com/ there is only zip file.

    I've a nokia n70.

  6. #6
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: ImportError

    Quote Originally Posted by ikaroweb80 View Post
    Where can i found the sis file?
    In this site http://cyke64.googlepages.com/ there is only zip file.

    I've a nokia n70.
    Here is the link: http://cyke64.googlepages.com/appswitch_selfsigned.sisx

  7. #7
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    54

    Re: ImportError

    I've tried to install the file and the phone does not support sisx file.

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

    Re: ImportError

    hi ikaroweb
    ur deveice is n70 and appswitch module is only for 3rd edition device only.
    hope u got it. plz have a feedback.
    thanks

  9. #9
    Regular Contributor
    Join Date
    Dec 2007
    Location
    India
    Posts
    133

    Re: ImportError

    Quote Originally Posted by bogdan.galiceanu View Post
    Bogdan, you forgot that N70 is 2nd Ed FP1, and appswitch is only for 3rd edition devices

    But it is a quite useful module, hope it can be ported to 2nd ed devices too.
    Kandyfloss

    V 7.0642.0
    18-10-06
    RH-51
    Nokia 7610

  10. #10
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    54

    Re: ImportError

    So I resolved!
    Do not put the two lines of code in the right sequence:
    Code:
    import sys
    sys.path.append('C:\\sys\\bin\\')
    import appswitch
    I did so:

    Code:
    import appswitch
    import sys
    sys.path.append('C:\\sys\\bin\\')

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

    Re: ImportError

    hi ikaroweb80
    did u really used ensymble for your n70 and it worked.
    give a feedback

Similar Threads

  1. ImportError: No module named _appuifw
    By ernesto.ferrari in forum Mobile Web Server
    Replies: 9
    Last Post: 2008-04-18, 05:36
  2. ImportError when adding modules
    By insyte in forum Python
    Replies: 3
    Last Post: 2006-09-07, 17:33

Posting Permissions

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