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

    ImportError: no module named 'pytrack'

    Scheduled Pinned Locked Moved WiPy 2&3
    5 Posts 3 Posters 60 Views 3 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.
    • N Offline
      NITIN Shivaraman
      last edited by

      Hi. I'm using WiPy 3.0 with Pytrack. Here are the list of things I did before running the program:

      1. Manually update firmware for Pytrack and update firmware for WiPy using the firmware update tool.
      2. Uploaded the files and verified that the files are available using an FTP client (files from https://github.com/pycom/pycom-libraries) - Used os.fsformat('/flash') to delete all the files and reuploaded multiple times.
      3. Tried the files in both shields/pytrack_1.py and examples/pytrack_pysense_acclerometer/main.py.

      I'm not sure if I have missed anything here but the library files are not found by the application file. Any help is appreciated regarding this issue.

      Thanks a lot in advance.

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @NITIN Shivaraman
        last edited by livius

        @NITIN-Shivaraman
        please show structure of your files and folders tree
        I ask, as import look for libraries in default locations like:
        '/flash', '/flash/lib'

        think about people first, then computers

        1 Reply Last reply Reply Quote 2
        • G Offline
          Gijs
          last edited by

          The file in 'shields/pytrack_1.py' should not require a module named 'Pytrack'. Though you should upload some of the files in 'shields/lib/...' as well (Im not sure of the other file, you'll have to check). You can check here: https://github.com/pycom/pycom-libraries/releases for the example with all the needed files. And indeed, check if you're uploading into the /flash and /flash/lib folders

          1 Reply Last reply Reply Quote 1
          • N Offline
            NITIN Shivaraman
            last edited by

            file_structure.png

            Thank you very much for the response. @livius I have attached the folder and files structure at the time of posting regarding the issue (the issue still exists with this structure).

            @Gijs The files in the release directory works! Thanks a ton!

            However, for better understanding, please advise on why the folder structure followed as per the https://github.com/pycom/pycom-libraries does not work. The application files (pytrack_1.py) are in the outer directory (shields) while the dependencies are placed in the lib folder rightfully. I even tried placing the files in the /flash/lib folder but ended up with the same error. Are the files expected in a different location?

            Thanks again for the support. It has been a great help!

            L 1 Reply Last reply Reply Quote 0
            • L Offline
              livius @NITIN Shivaraman
              last edited by livius

              @NITIN-Shivaraman
              if you have files which require import you must add it to search path as only /flash, /flash/lib are initially in the path
              e.g.

              import sys
              sys.path.append('/flash/shields')
              

              and all other folders
              sometimes easier life is to have all in max 2 folders as flat ;-)

              think about people first, then computers

              1 Reply Last reply Reply Quote 2

              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