Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    AttributeError: module 'sqnsupgrade' has no attribute 'run'

    Scheduled Pinned Locked Moved Firmware
    3 Posts 2 Posters 33 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      sdfg sdfg
      last edited by sdfg sdfg

      From the manual, to flash NB-IoT firmware:

      $ python3
      import sqnsupgrade
      sqnsupgrade.run('Serial_Port', '/path/to/upgdiff_old-to-new.dup')
      

      What happens in reality:

      sqnsupgrade.run('COM4', 'NB1-41019/NB1-41019.dup') 
      Traceback (most recent call last):  
      File "<stdin>", line 1, in <module> 
      AttributeError: module 'sqnsupgrade' has no attribute 'run'
      
      1 Reply Last reply Reply Quote 0
      • S Offline
        sdfg sdfg
        last edited by

        Fix: for others running into this same issue. I didn't RTFM properly. You absolutely need to set your terminal inside the directory where sqnsupgrade.py is located with the other *.py files (on the PC side). Don't put them in a sub-directory. I found it weird that Python found the module, but not the function within the module. Probably because I'm too n00b though.

        1 Reply Last reply Reply Quote 1
        • B Offline
          buffet Irvin
          last edited by

          Attribute errors in Python are generally raised when you try to access or call an attribute that a particular object type doesn't possess. It's simply because there is no attribute with the name you called, for that Object. This means that you got the error when the "module" does not contain the method you are calling. But it is evident that the method is there, which leads to believe that may be the method was added by you in the source code after you had already imported the file (module). Or, some times packages get deprecated and they rename some functions. If that is true, then you may want to exit and reimport the module once again to be able to access the new method .

          You can do it in another way to reimport the module with changes without having to exit the interpreter is to do the following:

          reload(myModule)
          

          If you are using python 3.2 or 3.3 you should:

          import imp
          imp.reload(myModule)
          

          If running Python 3.4 and up, do import importlib, then do:

          import importlib
          importlib.reload(myModule)
          

          The importlib.reload() method reload a previously imported module. The argument must be a module object, so it must have been successfully imported before .

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom