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

    how to pip3 install properly in order to use LoRa?

    Scheduled Pinned Locked Moved Guides
    9 Posts 5 Posters 72 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
      Axel Carré
      last edited by

      Hello,
      I'm doing a school project and I received a PyCom device that I'm using on my Raspberry in Python programs.
      My teacher provided me a code but actually I don't understand what I have to pip3 install in order to compile these two imports only: from network import LoRa and import ubinascii. I've managed to understand (I think) that they are from MicroPython but I can't any tutorial on how to setup all of this.
      I have the whole code (which I wasn't supposed to do, just run along with my own piece of code) but I just can't find a way to make it all work... :(
      Thanks in advance!

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @Axel Carré
        last edited by

        @Axel-Carré pip3 is a installer for the PC handling python3 packages, but the imports you mention run on the LoPy devices. So they are not related. I understand that this is confusing.
        And the pip3 command is not complete. It does not show what pip3 should install.

        A 1 Reply Last reply Reply Quote 1
        • A Offline
          Axel Carré @robert-hh
          last edited by

          @robert-hh Alright so do you know by any chance how to install all the needed libraries?

          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @Axel Carré
            last edited by robert-hh

            @Axel-Carré both network and ubinascii are already embedded into the LoPy4 (I assume it's the one) firmware. So you do not need to install it on the device.

            Edit: You can tell which modules are pre-installed on the Pycom device by the following command in the REPL:

            help('modules')

            Then you get a list of installed modules.

            >>> help('modules')
            __main__          machine           sys               upysh
            _boot             math              time              uqueue
            _main             micropython       ubinascii         ure
            _thread           mount             ubinascii         uselect
            array             network           ucollections      uselect
            binascii          os                ucrypto           usocket
            builtins          pycom             uctypes           ussl
            cmath             pye_mp            uerrno            ustruct
            crypto            queue             uerrno            utime
            errno             re                uhashlib          utimeq
            framebuf          select            uio               uzlib
            gc                socket            ujson
            hashlib           ssl               umachine
            json              struct            uos
            Plus any modules on the filesystem
            >>> 
            

            P.S.: Both modules do NOT exist on the Raspberry Pi. There may be a network module, but with different classes. And instead ubinascii there is binascii. But that is irrelevant, since you have to run your code on the Pycom device, not on the RasPi.

            K 1 Reply Last reply Reply Quote 1
            • K Offline
              kjm @robert-hh
              last edited by

              @robert-hh Just curious Rob, why are there 2 copies of ubinascii, uselect, etc?

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @kjm
                last edited by

                @kjm Some modules have a non-u alias for compatibility. Don't ask me why some have and others not. But it's only an alias. The module itself exists only once.

                L 1 Reply Last reply Reply Quote 0
                • L Offline
                  livius @robert-hh
                  last edited by livius

                  @robert-hh
                  He ask about same name not without "u" ;-)
                  there are e.g. 2xuselect 2xubinascii 2xuerrno

                  think about people first, then computers

                  robert-hhR 1 Reply Last reply Reply Quote 0
                  • robert-hhR Offline
                    robert-hh @livius
                    last edited by

                    @livius right. I did not see that, and I have no clue why, and why only these three.

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

                      I looked around in the firmware to find any double definitions, but could not find anything concrete why these three are duplicated. Though its probably limited to only the help-function printing code, meaning there's no fundamental flaw in the firmware

                      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