[yocto] Python Error in SDK

Erik Bolton EBolton at agjunction.com
Mon Apr 6 23:44:01 PDT 2015


Hey All;


This has been brought up before (although I think the error was different), but I'm having a lot of issues with the version of Python included with the SDK.


We use Python for code generation as part of our project. If I source the environment script and try to run our Python scripts I get this:


Traceback (most recent call last):
  File "/opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/python2.7/site.py", line 569, in <module>
    main()
  File "/opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/python2.7/site.py", line 551, in main
    known_paths = addusersitepackages(known_paths)
  File "/opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/python2.7/site.py", line 278, in addusersitepackages
    user_site = getusersitepackages()
  File "/opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/python2.7/site.py", line 253, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/python2.7/site.py", line 242, in getuserbase
    from sysconfig import get_config_var
  File "/opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/python2.7/sysconfig.py", line 10, in <module>
    'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
AttributeError: 'module' object has no attribute 'lib'

If I try running something that doesn't exist I get this:

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted (core dumped)

I've tried using update-alternatives to point the SDK python to my local python (Ubuntu 14.10, Python 2.7.8), but the errors persist.

I know a few people have simply deleted the python binary from the SDK, but I don't think that will help in my case.

I would try to remove it from the SDK in the actual package groups, but smartpm and a few other programs depend on it. I'm not sure they would play nice with my local version.

Any suggestions on how to fix this "correctly"?

Thanks very much.
-Erik
Disclaimer: This message contains information that may be privileged or confidential and is the property of AgJunction Inc and its subsidiaries. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20150407/07c7417d/attachment.html>


More information about the yocto mailing list