Navigation

    UBports Robot Logo

    UBports Forum

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

    can't install pyserial

    Support
    3
    6
    194
    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.
    • G
      gascls65 last edited by gascls65

      hello, everybody! I am trying to install the pyserial package to my phone Nexus 5 via downloaded tar.gz archive, but the installation fails. can you please check the commands and suggest whats wrong? thanks in advance!

      1. tar -xzf pyserial-3.4.tar.gz -> OK
      2. cd /pyserial-3.4
      3. sudo python3.5 setup.py install -> ends with «error: could not create '/usr/local/lib/python3.5/dist-packages/serial': Read-only file system»
        I tried changing the permission for this folder with «sudo chmod -R g+w /usr...dist-packages/» but that was also not successful. I woder do I have rights to access there at all?
        Please help me, I want to install new packages and acces other devices over serial. Thanks in adance!
      H 1 Reply Last reply Reply Quote 0
      • H
        hummlbach @gascls65 last edited by hummlbach

        @gascls65 the root filesystem is mounted read only. You can mount it writable with sudo mount -o remount,rw /. But be aware your changes may be gone after updating the os/installing an ota update. You may prefer installing the python package into your home.

        1 Reply Last reply Reply Quote 1
        • G
          gascls65 last edited by

          @hummlbach thanks for the suggestion.
          Installing in home is not a bad idea, but sonce im not an expert, do u know how to install in home ensuring that the serial will still be importable?

          1 Reply Last reply Reply Quote 0
          • H
            hummlbach last edited by hummlbach

            Not entirely sure, but I don't think it looks in your home by default. So you may have to set the environment variable PYTHONPATH to ~/lib/python3.5/ for example in .profile and (try to) install pyserial into it by executing setup.py install --user for example. (maybe you need to create the directories before manually by mkdir -p ~/lib/python3.5 - not sure.)

            1 Reply Last reply Reply Quote 0
            • G
              gascls65 last edited by

              @hummlbach I took the suggestion with file system remount, worked very fine and now I am able to do what I wanted when I bought Nexus 5 and installed UbuntuTouch - connect my phone with anything including via serial port !!!
              Thank you very much, I already love everything here! 😃

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

                You could install such things in a libertine container instead.

                However, there are no USB serial adapter drivers built into the kernels on the images, so I guess you might not get very far with pyserial yet. 🙂

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