Navigation

    UBports Robot Logo

    UBports Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Python coding from libertine ?

    Libertine
    3
    9
    399
    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
      marek_python last edited by

      Hi community,
      I'd appreciated your thoughts on Python scripting on UT.
      It's no surprise (now) to me that I can't install python packages via pip using terminal app since apt install python3-pip won't work.

      Libertine is the way to go. I could install pip from what I remember but now I wonder how I go about scripts that use Python's socket module ? Will I be able to use scapy from within the container ? I'm getting tablet running UT so I'm thinking about my options.

      Have you done any scripting using socket module ? How did you go about it ?

      1 Reply Last reply Reply Quote 0
      • dobey
        dobey last edited by

        Yes, you should be able to install any Python module you need (so long as it is available to install on your device's architecture), with pip inside a Libertine container.

        You may have an issue if you are trying to run something in perpetuity within the container as a server for example, or in some certain other situations, but in general most things should just work as normal. Just remember that there is no sudo in the container, and you should not install it in the container as it will cause things to break.

        M 1 Reply Last reply Reply Quote 1
        • M
          marek_python @dobey last edited by

          @dobey
          I'll probably run into some issues then. Because scapy won't run without superuser privileges. I gotta find a way.

          dobey 1 Reply Last reply Reply Quote 0
          • dobey
            dobey @marek_python last edited by

            @marek_python Why would scapy need that? But you can also run libertine-container-manager exec -i xenial -c bash for example to get a "root" (it's an unprivileged container, but in fakeroot mode in this case).

            M 2 Replies Last reply Reply Quote 0
            • M
              marek_python @dobey last edited by

              @dobey
              I'll defo try that. Thank you @dobey

              Perhaps someone else will chime in with different experience.

              1 Reply Last reply Reply Quote 0
              • M
                marek_python @dobey last edited by marek_python

                @dobey
                Great news. I've just tried the fake root on my UT phone and scapy worked fine. No permission errors. Exciting times ahead. 🙂

                Is it just on my phone or Terminal app crashes under screen lock ? It crashed twice after unlocking screen.

                dobey 1 Reply Last reply Reply Quote 0
                • dobey
                  dobey @marek_python last edited by

                  @marek_python The terminal app, and any child processes running in it, get paused when the screen locks. It shouldn't be crashing.

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    marek_python @dobey last edited by

                    @dobey
                    I'll be testing it and if it keeps crashing on my devices I'll report it as an issue so the community knows.

                    1 Reply Last reply Reply Quote 0
                    • K
                      kugiigi last edited by

                      Disable app suspension for the terminal app on the tweak tool if you want.
                      Also, if you plan to create apps, you can try Seabass. It's a great code editor and supports creating a libertine container for building via clickable.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post