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

    Error when importing pysense/pytrack

    Scheduled Pinned Locked Moved FiPy
    fipy firmwarepysensepytrack
    11 Posts 5 Posters 3.6k Views 5 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.
    • A Offline
      adrien3d
      last edited by

      I have a pytrack and a pysense (with a SiPy running 1.15.0.b1), and when running related examples pytrack and pysense, i have import errors.

      For pysense:

      Traceback (most recent call last):
      File "sense.py", line 1, in <module>
      ImportError: no module named 'pysense.Pysense'
      

      For pytrack:

      Traceback (most recent call last):
      File "track.py", line 10, in <module>
      ImportError: no module named 'L76GNSS'
      

      Do you have any idea to fix this?

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino @adrien3d
        last edited by jmarcelino

        Hi @adrien3d
        That tells you that your program can't find L76GNSS.py or pysense.py files it needs.

        Have you uploaded those files to your board? They should be placed under the lib/ folder

        If you use Pymakr check if you those files are part of your project and you uploaded the project correctly

        A E 2 Replies Last reply Reply Quote 1
        • A Offline
          adrien3d @jmarcelino
          last edited by

          @jmarcelino You're right, rookie move, I had forgotten to include librairies, thanks ;)

          1 Reply Last reply Reply Quote 1
          • E Offline
            expectthebest @jmarcelino
            last edited by expectthebest

            @jmarcelino I am having the same issue, however I am using a GPy. I have uploaded the files to the lib folder.

            I've included a screen shot for proof the files are in the lib folder.

            Not sure what the solution is?

            0_1520870761666_4de460f4-e9e2-4437-83cf-b8b88d7adc7c-image.png

            0_1520870833122_b72ce2f6-80ad-435b-9f00-958925f12f5d-image.png

            0_1520871072603_34d53ee6-9757-4c62-bda7-5ce334d658c1-image.png

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              jmarcelino @expectthebest
              last edited by

              @expectthebest

              can you try deleting all the existing files with os.mkfs('/flash') and trying to upload again?

              E 1 Reply Last reply Reply Quote 1
              • E Offline
                expectthebest @jmarcelino
                last edited by

                @jmarcelino said in Error when importing pysense/pytrack:

                os.mkfs('/flash')

                That did the trick. Thank you.

                1 Reply Last reply Reply Quote 1
                • C Offline
                  Cormac
                  last edited by

                  I am getting the same error as above:

                  from pytrack import Pytrack
                  Traceback (most recent call last):
                  File "<stdin>", line 1, in <module>
                  ImportError: no module named 'pytrack.Pytrack'

                  I am a total newbie so its probably something silly. I have uploaded the project including the files in the lib folder. Using Visual Studio Code and Pymakr.
                  If the solution is os.mkfs('/flash') how do I run this ?

                  R 1 Reply Last reply Reply Quote 0
                  • R Offline
                    railmonitor @Cormac
                    last edited by

                    @Cormac You should be able to enter it in he Pymakr console. Remember to first write:

                    import os
                    

                    then

                    os.mkfs('/flash')
                    

                    However i am not able to use the mkfs command, probably been replaced, but i can do:

                    os.fsformat('/flash')
                    

                    which does the trick!

                    C 2 Replies Last reply Reply Quote 0
                    • C Offline
                      Cormac @railmonitor
                      last edited by

                      @railmonitor Thank you I will give that a try

                      1 Reply Last reply Reply Quote 0
                      • C Offline
                        Cormac @railmonitor
                        last edited by

                        @railmonitor

                        Sorry that I only got to this now.. I tried that in the Console after connecting and I get the same error when trying to use os.

                        Connecting to COM4...

                        import os
                        os.mkfs('/flash')
                        Traceback (most recent call last):
                        File "<stdin>", line 1, in <module>
                        AttributeError: 'module' object has no attribute 'mkfs'

                        Cormac

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          railmonitor
                          last edited by

                          @Cormac Yeah the mkfs method has been renamed or just removed. Use

                          os.fsformat('/flash')
                          

                          instead, as i also wrote in my previous post.

                          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