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

    Importing Pycom Libraries

    Scheduled Pinned Locked Moved Discussion
    2 Posts 2 Posters 79 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.
    • M Offline
      MichaelWojcik
      last edited by

      Hello,

      I am having some issues importing the library for the pytracker.

      I know that its probably something stupid simple, but I have not been able to figure out what I am doing wrong.

      I downloaded all of the libraries from the github and I have tried structuring them like this:
      floder2.PNG

      and I get the following error when importing pytrack [picture for exact code]

      error 2.PNG

      ImportError: no module called 'pycoproc.Pycoproc'
      

      This also persists if I mode pycoproc.py out into the main lib directory, which I thought could also be the problem based on how the modules were structured in the github repo.

      What am I doing wrong?

      D 1 Reply Last reply Reply Quote 0
      • D Offline
        d.alvrzx @MichaelWojcik
        last edited by

        @MichaelWojcik Yes, the convention is to have all library files in the lib/ directory, no subdirectories. Or at least that's how it's worked out for me.

        Regarding your issue, I believe it stems from you doing import pycoproc.Pycoproc, when you should really be doing from pycoproc import Pycoproc

        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