# How to install pyserial in wp8548g

**URL:** <https://mangoh.discourse.group/t/how-to-install-pyserial-in-wp8548g/489>\
**Category:** Uncategorized\
**Created:** [April 18, 2017, 5:45am UTC](https://mangoh.discourse.group/t/how-to-install-pyserial-in-wp8548g/489 "2017-04-18T05:45:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![umesh-gp](https://avatars.discourse-cdn.com/v4/letter/u/90db22/32.png) [@umesh-gp](https://mangoh.discourse.group/u/umesh-gp)\
**Post date:** [April 18, 2017, 5:45am UTC](https://mangoh.discourse.group/t/how-to-install-pyserial-in-wp8548g/489/1 "2017-04-18T05:45:38Z")

</div>

I am trying to install any python package in wp8548g.  
i am trying with OPKG package manger.  
but it shows always. i am root user. but i cannot change the permission.its keep showing same messgae always.  
can not create **/usr/lib/python2.7/site-package read only system.**  
for that i have python-pyserial\_2.4-ml4.3\_armv7a-vfp-neon.ipk file  
Is there any mechanism to install package on other directory rather then /usr/lib/python2.7/site-package?  
i need to install \> python-pyserial to communicate with serial usb device.  
so can you pleas guide how to do it either on by default linux in module or re-flash it after custom few configurations.

below is the error log during installation-  
root@swi-mdm9x15:~# opkg install python-pyserial\_2.4-ml4.3\_armv7a-vfp-neon.ipk --force-depends  
Installing python-pyserial (2.4-ml4.3) on /home/root/Envs.  
Configuring python-pyserial.  
Collected errors:

- satisfy\_dependencies\_for: Cannot satisfy the following dependencies for python-pyserial:
- python-io \* python-fcntl \* python-stringold \*
- extract\_archive: Cannot make dir /usr/lib/python2.7/site-packages/: Read-only file system.
- extract\_archive: Cannot make dir /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/SOURCES.txt: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/top\_level.txt: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/dependency\_links.txt: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/pyserial-2.4-py2.7.egg-info/PKG-INFO: No such file or directory.
- extract\_archive: Cannot make dir /usr/lib/python2.7/site-packages/serial/: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialcli.pyo: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialwin32.py: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/ **init**.pyo: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialwin32.pyo: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialposix.py: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/ **init**.py: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/sermsdos.py: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialjava.py: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialutil.pyo: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialposix.pyo: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialutil.py: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialcli.py: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/sermsdos.pyo: No such file or directory.
- wfopen: /usr/lib/python2.7/site-packages/serial/serialjava.pyo: No such file or directory.

root@swi-mdm9x15:~# df -h  
Filesystem Size Used Available Use% Mounted on  
devtmpfs 256.0K 0 256.0K 0% /dev  
/dev/ubiblock0\_0 24.9M 24.9M 0 100% /  
mdev 256.0K 0 256.0K 0% /dev  
tmpfs 74.1M 0 74.1M 0% /dev/shm  
tmpfs 74.1M 0 74.1M 0% /run  
tmpfs 74.1M 64.0K 74.1M 0% /var  
tmpfs 74.1M 44.0K 74.1M 0% /tmp  
/dev/ubi2\_0 16.8M 4.3M 11.6M 27% /mnt/flash  
/dev/ubiblock1\_0 2.3M 2.3M 0 100% /mnt/legato  
/dev/mtdblock5 5.0M 1.3M 3.7M 27% /mnt/userrw  
aufs 16.8M 4.3M 11.6M 27% /etc  
aufs 16.8M 4.3M 11.6M 27% /data  
/dev/ubi2\_0 16.8M 4.3M 11.6M 27% /legato  
/dev/ubi2\_0 16.8M 4.3M 11.6M 27% /home  
cgroupsRoot 74.1M 0 74.1M 0% /sys/fs/cgroup  
/dev/ubi2\_0 16.8M 4.3M 11.6M 27% /legato/systems/current

and from **df -h** it shows /dev/ubiblock0\_0 is fully occupied all space. and from my understanding that’s why the write permissions are removed by admin panel.

---

<div class="post-metadata">

**Author:** ![pankaj](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@pankaj](https://mangoh.discourse.group/u/pankaj)\
**Post date:** [April 19, 2017, 6:04am UTC](https://mangoh.discourse.group/t/how-to-install-pyserial-in-wp8548g/489/2 "2017-04-19T06:04:53Z")

</div>

Hi Umesh-gp,

The pyserial recipe is available in the meta-python layer at the location yocto\meta-embedded\meta-python\recipes-devtools\python.

You can bitbake the recipe with bitbake python-piserial and add it to the “9615-cdp-sierra-image.inc” file located at “meta-swi-extras/common/recipes/images/9615-cdp-sierra-image.inc”.

To add piserial you will need to add the below line to the file:  
IMAGE\_INSTALL += “python-pyserial” ///python-pyserial is your recipe name.

Hope this helps.

Thanks

---

<div class="post-metadata">

**Author:** ![umesh-gp](https://avatars.discourse-cdn.com/v4/letter/u/90db22/32.png) [@umesh-gp](https://mangoh.discourse.group/u/umesh-gp)\
**Post date:** [April 19, 2017, 8:00am UTC](https://mangoh.discourse.group/t/how-to-install-pyserial-in-wp8548g/489/3 "2017-04-19T08:00:09Z")

</div>

This is now working.

Thanks a lot for this help.

---

<div class="post-metadata">

**Author:** ![umesh-gp](https://avatars.discourse-cdn.com/v4/letter/u/90db22/32.png) [@umesh-gp](https://mangoh.discourse.group/u/umesh-gp)\
**Post date:** [July 14, 2017, 4:39am UTC](https://mangoh.discourse.group/t/how-to-install-pyserial-in-wp8548g/489/4 "2017-07-14T04:39:34Z")

</div>

I have found some interesting way to do same without doing much effort work.

Just use opkg config file to install python package in sd card after mounting it.  
in my case i mounted it to /media/

then you will have basic structure of folders inside sd card automatically.

then just copy paste all python package from sd card of raspberry pi.

and you can use all your python packages from /media/usr/bin/python  
it is working similar to virtual environment for me.

I want to know that if it is good way to execute other python-package depended script.

---

<div class="post-metadata">

**Author:** ![virpadte](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/virpadte/32/245_2.png) [@virpadte](https://mangoh.discourse.group/u/virpadte)\
**Post date:** [August 1, 2018, 7:44pm UTC](https://mangoh.discourse.group/t/how-to-install-pyserial-in-wp8548g/489/5 "2018-08-01T19:44:51Z")

</div>

Hi @umesh-gp,

Can you tell exactly the steps you followed. I am stuck at the same problem. I did a bitbake python-pyserial and then added the line IMAGE\_INSTALL += “python-pyserial” to my receipe. And then did a bitbake mdm9x15-image-minimal to generate a yocto\_wp85.cwe. When I flashed the image, I still cannot import pyserial in python. Am I missing something?

---

<div class="post-metadata">

**Author:** ![pankaj](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@pankaj](https://mangoh.discourse.group/u/pankaj)\
**Post date:** [August 6, 2018, 3:21pm UTC](https://mangoh.discourse.group/t/how-to-install-pyserial-in-wp8548g/489/6 "2018-08-06T15:21:23Z")

</div>

Hi @virpadte,

What is the exact error you see for import pyserial ? Is it related to importlib? I faced a similar error and you will have to add python-importlib before python-pyserial which should allow you to import pyserial

---

<div class="post-metadata">

**Author:** ![samjiks1](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@samjiks1](https://mangoh.discourse.group/u/samjiks1)\
**Post date:** [September 16, 2018, 5:25pm UTC](https://mangoh.discourse.group/t/how-to-install-pyserial-in-wp8548g/489/7 "2018-09-16T17:25:50Z")

</div>

Can anyone help me get to python working on MangOH as I still understanding yocto project.
