Issue compiling python 2.7.1

Home Forums MultiConnect OCG Issue compiling python 2.7.1

Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #5622
    Alexey Klimenko
    Participant

    Hi
    Thank you for your help on my previous posts. At the moment I have a problem with python 2.7.1
    There is a bb recipe for it and I somehow managed to compile corecdp-python-image with version 2.7.1
    However after flashing the device I get the following error when running ‘python’ command:
    # python
    Traceback (most recent call last):
    File “/usr/lib/python2.7/site.py”, line 62, in <module>
    import os
    File “/usr/lib/python2.7/os.py”, line 398, in <module>
    import UserDict
    File “/usr/lib/python2.7/UserDict.py”, line 83, in <module>
    import _abcoll
    File “/usr/lib/python2.7/_abcoll.py”, line 11, in <module>
    from abc import ABCMeta, abstractmethod
    File “/usr/lib/python2.7/abc.py”, line 8, in <module>
    from _weakrefset import WeakSet
    ImportError: No module named _weakrefset

    Couldn’t find online any solution for this. I would appreciate your advice here. What is the proper way to use 2.7.1 instead of default 2.6?
    Regards,
    Alexey

    #5624
    Mike Fiore
    Blocked

    Alexey,
    If you’re willing to share your recipe for Python 2.7.1, we could probably include it in a future CoreCDP release. If that’s the case, you can either post it on this thread or email it to me at mfiore@multitech.com.

    The issue detailed shows the same trace that you posted. There was talk in that thread and that, if you are using virtualenv with python, upgrading virtualenv resolved the issue.

    Hope this helps!
    Mike

    #5625
    Mike Fiore
    Blocked

    Shoot! My links didn’t make it through

    First link: https://github.com/pypa/virtualenv/issues/76

    Second link: http://blog.hugeaim.com/2012/06/09/no-module-named-_weakrefset-in-linux-mint/

    Cheers!
    Mike

    #5627
    Alexey Klimenko
    Participant

    Mike,
    Thank you for assistance.
    I used the 2.7.1 recipe that already came with CoreCDP – simply replaced content of python.inc to point to 2.7.1
    As for virtualenv, I have seen these post but is it applicable to my situation? I cannot see that virtualenv is installed at all and also there are no recipes for it.

    Regards,
    Alexey

    #5628
    Mike Fiore
    Blocked

    Alexey,
    It looks like there is a separate .inc file for Python 2.7. The existence of that file indicates that the build process for earlier Python versions probably isn’t the same as the process for 2.7. I would suggest reverting the changes you made to python.inc and instead setting

    PREFERRED_VERSION_python = "2.7.1"

    in multitech/conf/distro/corecdp.conf. This will cause 2.7.1 to be built as the default Python version.

    Cheers,
    Mike

    #5629
    Alexey Klimenko
    Participant

    Thank you. However the provided recipe doesn’t compile:

    Traceback (most recent call last):
    |   File "./setup.py", line 9, in <module>
    |     import sysconfig
    | ImportError: No module named sysconfig
    | make: *** [sharedmods] Error 1
    | + die 'oe_runmake failed'
    

    Prepending do_compile with ./configure (as used to compile 2.7.1 normally) causes error cannot run c programs

    Regards,
    Alexey

    #5632
    Mike Fiore
    Blocked

    Hi Alexey,
    I’ve been trying to get Python 2.7.1 working here at the office and it hasn’t been a fun process so far. I finally got Python compiling and installing, but running it on an OCG still failed. There were modules mising that 2.7.1 required. I copied over those modules (they were in the build directory, just hadn’t been installed by default), but even then, I still saw an error when trying to invoke Python.

    It seems like there are some pretty serious issues with the recipe and the resulting Python installation. My guess is that it was half-baked to begin with and probably never maintained or improved because of the general shift to oe-core.

    One thing you could try is taking a Python recipe form oe-core and back-porting it to oe-classic. Sometimes, if the recipes are similar to begin with, this isn’t too much work. I won’t make any guarantees, however. 🙂

    If you want the dirty details of what I did to get where I did with Python 2.7.1, let me know. I unfortunately can’t put any more time into this right now. If you end up getting something working, please share your results!

    Cheers,
    Mike

    #5633
    Alexey Klimenko
    Participant

    Thank you Mike!
    I will try to back port my app to 2.6.6 to start with.
    Is there any way I compile python directly on he device? At least it will help me with prototyping and later I will give bit bake task to someone else to work on 😉

    Regards,
    Alexey

    #5634
    Mike Fiore
    Blocked

    Alexey,
    I’m not sure what you mean by “compiling python directly on the device”. Your OCG should have shipped with corecdp-full-image on it, which includes Python. There is also a smaller image, corecdp-python-image, that also includes Python. The Python version is 2.6.6 in both cases, so if you’re able to use 2.6.6, you should be able to run your application on the OCG without building a custom image.
    Thanks,
    Mike

    #5799
    lewis wight
    Participant

    Has this issue been fixed yet? I have to have python 2.7 or my project will not work on this device. Please let me know, thanks!

    #5824
    Mike Fiore
    Blocked

    Lewis,
    As far as I know, this issue with OE-Classic hasn’t been resolved. OE-Classic is no longer being maintained at this point. We are hoping to release a version of CoreCDP that is compatible with OE-Core in the future, but that release date is still TBD.

    It may be possible to take a Python 2.7 recipe from OE-Core and port it back to OE-Classic for the time being. Depending on the recipe, this can, but is not guaranteed to be, a fairly easy process.

    Cheers,
    Mike Fiore

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.