ImportError: cannot import name 'spawn'


#1

Hi all,

I am facing some trouble while building up webos ose image for qemux86.

Can you please check and resolve my problem?

It occurs when making webos-image.

My environment is Ubuntu MATE 18.04 .

~/webOS_env/build-webos: sudo make webos-image
for MACHINE in qemux86 ; do . ./oe-init-build-env && bitbake webos-image; done
Altered environment for qemux86@webos development
Traceback (most recent call last):
File "/home/[USER]/webOS_env/build-webos/bitbake/bin/bitbake", line 31, in
import bb
File "/home/[USER]/webOS_env/build-webos/bitbake/lib/bb/init.py", line 79, in
from bb import fetch2 as fetch
File "/home/[USER]/webOS_env/build-webos/bitbake/lib/bb/fetch2/init.py", line 1782, in
from . import clearcase
File "/home/[USER]/webOS_env/build-webos/bitbake/lib/bb/fetch2/clearcase.py", line 73, in
from distutils import spawn
ImportError: cannot import name 'spawn'
Makefile:42: recipe for target 'webos-image' failed
make: *** [webos-image] Error 1

Many thanks in advance :slight_smile:


#2

sudo apt-get install python3-distutils


#3

Also this part doesn't make much sense, you're supposed to use sudo to run scripts/prerequisites.sh, but then you shouldn't use sudo (bitbake will actually refuse to run if you try to build under root).

"make webos-image" and ". ./oe-init-build-env && bitbake webos-image" is basically the same thing, the first will just fail for you because of sudo.

And normally you do ". ./oe-init-build-env" once, before the for loop, it doesn't need to be executed between each MACHINE if you're building for multiple MACHINEs.


#4

Thanks Jema.
But there is another error. I think it is about database problem but I don't understand why it happened.

for MACHINE in qemux86 ; do . ./oe-init-build-env && bitbake webos-image; done
Altered environment for qemux86@webos development
ERROR: Error parsing configuration files
Traceback (most recent call last):
File "/home/[USER]/webOS_env/build-webos/bitbake/lib/bb/cookerdata.py", line 268, in CookerDataBuilder.parseBaseConfiguration():
if self.data.getVar("BB_WORKERCONTEXT", False) is None:
> bb.fetch.fetcher_init(self.data)
bb.codeparser.parser_cache_init(self.data)
File "/home/[USER]/webOS_env/build-webos/bitbake/lib/bb/fetch2/init.py", line 504, in fetcher_init(d=<bb.data_smart.DataSmart object at 0x7f5bf363e860>):
pass
> revs.clear()
else:
File "/home/[USER]/webOS_env/build-webos/bitbake/lib/bb/persist_data.py", line 147, in SQLTable.clear():
def clear(self):
> self._execute("DELETE FROM %s;" % self.table)

File "/home/[USER]/webOS_env/build-webos/bitbake/lib/bb/persist_data.py", line 66, in SQLTable._execute(*query=('DELETE FROM BB_URI_HEADREVS;',)):
try:
> return self.cursor.execute(*query)
except sqlite3.OperationalError as exc:
sqlite3.OperationalError: attempt to write a readonly database

Makefile:42: recipe for target 'webos-image' failed
make: *** [webos-image] Error 1


#5

Check your filesystem.


#6

Or the permissions, if you managed to create the database under root, then it's probably readonly for normal user. Delete BUILD and cache directory and start again. Or chown -R whole directory to your regular user.