Issue compiling python 2.7.1
Home › Forums › MultiConnect OCG › Issue compiling python 2.7.1
Tagged: python
- This topic has 10 replies, 3 voices, and was last updated 10 years, 5 months ago by Mike Fiore.
-
AuthorPosts
-
March 25, 2014 at 3:45 am #5622Alexey KlimenkoParticipant
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 _weakrefsetCouldn’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,
AlexeyMarch 25, 2014 at 7:53 am #5624Mike FioreBlockedAlexey,
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!
MikeMarch 25, 2014 at 7:54 am #5625Mike FioreBlockedShoot! 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!
MikeMarch 25, 2014 at 11:56 am #5627Alexey KlimenkoParticipantMike,
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,
AlexeyMarch 25, 2014 at 4:30 pm #5628Mike FioreBlockedAlexey,
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 settingPREFERRED_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,
MikeMarch 26, 2014 at 1:17 am #5629Alexey KlimenkoParticipantThank 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,
AlexeyMarch 26, 2014 at 12:46 pm #5632Mike FioreBlockedHi 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,
MikeMarch 26, 2014 at 1:45 pm #5633Alexey KlimenkoParticipantThank 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,
AlexeyMarch 26, 2014 at 2:42 pm #5634Mike FioreBlockedAlexey,
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,
MikeMay 16, 2014 at 4:20 pm #5799lewis wightParticipantHas 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!
June 3, 2014 at 4:11 pm #5824Mike FioreBlockedLewis,
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 -
AuthorPosts
- You must be logged in to reply to this topic.