[yocto] Problem with Python in pre-built SDK

Ben Warren Ben.Warren at spidercloud.com
Thu May 16 14:53:33 PDT 2013


Hi,

I'm having other Yocto problems using the stock Ubuntu x86_64 toolchain, so decided to install one using the instructions in section 2.1.2 (Using a Cross-Toolchain Tarball) of the "Yocto Project Application Developer's Guide".

These are the commands I used:

$ wget http://downloads.yoctoproject.org/releases/yocto/yocto-1.4/toolchain/x86_64/poky-eglibc-x86_64-x86_64-toolchain-gmae-1.4.sh
$ sudo sh poky-eglibc-x86_64-x86_64-toolchain-gmae-1.4.sh

and installed at the default (/opt/poky/1.4)

Now, I go through the usual steps:

========
ben at ubuntu-scw:~$ cd /opt/poky
ben at ubuntu-scw:/opt/poky$ . oe-init-build-env ../scw-appscard-build/

### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

You can also run generated qemu images with a command like 'runqemu qemux86'
========

At this point, I guess I need to source the SDK environment file so poky knows where the toolchain is?

========
ben at ubuntu-scw:/opt/scw-appscard-build$ . /opt/poky/1.4/environment-setup-x86_64-poky-linux
========

Then I try to build something

========
ben at ubuntu-scw:/opt/scw-appscard-build$ MACHINE=scw-appscard bitbake kvm-image-minimal
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named distutils.version
Traceback (most recent call last):
  File "/opt/poky/bitbake/bin/bitbake", line 34, in <module>
    import bb
  File "/opt/poky/bitbake/lib/bb/__init__.py", line 75, in <module>
    import bb.msg
  File "/opt/poky/bitbake/lib/bb/msg.py", line 32, in <module>
    import bb.event
  File "/opt/poky/bitbake/lib/bb/event.py", line 34, in <module>
    import bb.utils
  File "/opt/poky/bitbake/lib/bb/utils.py", line 22, in <module>
    import re, fcntl, os, string, stat, shutil, time
ImportError: No module named fcntl
========

So it looks like the Python included with the SDK is crippled or mis-configured:

========
ben at ubuntu-scw:/opt/scw-appscard-build$ which python
/opt/poky/1.4/sysroots/x86_64-pokysdk-linux/usr/bin/python
ben at ubuntu-scw:/opt/scw-appscard-build$ python
Python 2.7.3 (default, Apr 19 2013, 00:50:43) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fcntl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named fcntl
>>> 
========

Without sourcing the SDK environment file:

========
ben at ubuntu-scw:~$ which python
/usr/bin/python
ben at ubuntu-scw:~$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fcntl
>>>
========

Am I following the playbook correctly?  Does this Python need an explicit PYTHONPATH or something like that?
Note that I'm using poky at the 'Dylan 9.0' tag and have Ubuntu 12.10 x86_64 on the host.

thanks,
Ben







More information about the yocto mailing list