can't install pyserial
-
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!
- tar -xzf pyserial-3.4.tar.gz -> OK
- cd /pyserial-3.4
- 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!
-
@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. -
@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? -
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) installpyserial
into it by executingsetup.py install --user
for example. (maybe you need to create the directories before manually bymkdir -p ~/lib/python3.5
- not sure.) -
@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! -
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.