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

    lib folder "not working"

    Scheduled Pinned Locked Moved LoPy
    importerrorlopylib folder
    6 Posts 3 Posters 1.3k 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.
    • S Offline
      Spoon
      last edited by Spoon

      I am using an LoPy with an pysense-board.
      I am trying to import Pysense (from pysense import Pysense) which is placed in the lib folder.
      i am always getting this error:
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      ImportError: no module named 'pysense.Pysense'

      it doesn't matter if pycoproc.py is on the same level as main.py or in the lib folder --> same Error
      it works when i put all the files on the same level like main.py
      sys.path looks like this:['', '/flash', '/flash/lib'], so it should work i guess.

      i am working on mac os x with Atom and pymakr plug in.

      any recommendations? thx

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

        @spoon

        IIRC this can happen if you have a file named pysense.py in your main /flash folder as well as /flash/lib

        Make sure you only have one pysense.py

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          Spoon @jmarcelino
          last edited by

          @jmarcelino there is only one pysense.py file....

          J L 2 Replies Last reply Reply Quote 0
          • J Offline
            jmarcelino @Spoon
            last edited by

            @spoon
            Ok then maybe the contents have some problem? Try erasing it e.g. os.unlink('/flash/pysense.py'), re-upload and try again.

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

              @spoon

              there is only one pysense.py file....

              How do you checked this? From atom plugin?
              Better look into device by ftp.

              think about people first, then computers

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                Spoon @livius
                last edited by

                @livius thx for your advice, there haven't been a second pysense.py but a lot of other crap and folders, i deleted them now it is working fine! Thank you! i will now use ftp to upload my libs or at least check if everything is ok

                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