-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python 3] AttributeError: 'function' object has no attribute 'im_func' #124
Comments
https://docs.python.org/2/reference/datamodel.html says:
(but we don't care about Python 2 here, anyway) and https://docs.python.org/3/library/2to3.html?highlight=im_func#2to3fixer-methodattrs I'll update #123 |
I think I had this working not so long ago. Are you sure that Gepetto-viewer did not get confused (i.e. it really uses omniidl from your build) ? |
I can find |
I checked on the workspace I used. I did not generate the doc, so obviously, it worked. |
4.2.3 is available, I'll try to update |
Yes, #123 works, but this is a separate issue |
Do you mean that the documentation generation (and execution) works with Python 3 and OmniORB 4.2.3 ? |
No change between 4.2.2 & 4.2.3. With the
So I think that documentation generation (and execution) almost works with Python 3 and OmniORB 4.2.2 |
I am fine with using sed as long as it is well commented in CMakeLists.txt. |
I tried nim65s/jrl-cmakemodules@5294b95 without success, but with https://github.com/nim65s/robotpkg/blob/0730604/middleware/omniORBpy/patches/patch-af it works, so we could do with it. |
It's weird nim65s/jrl-cmakemodules@5294b95 didn't work. We will have issues later on distribution where OmniORB 4.2.3 is already supported. We can postpone the problem and hope that you change will be accepted by OmniORB devs. |
Is there any progress on this one? When installing gepetto-gui via gepetto/homebrew-gepetto 1 it installs OmniORB 4.2.3 and I run into this problem. My current workaround is to do the substitution as proposed in the first comment. |
As far as I understand, there is a mix between Python 2 and Python 3. If you have the documentation, it means you use Python 3, don't you ? |
And you need omniidl (and omniidl-python) 4.2.3 to have Python 3 working properly. |
I've installed all omni related things through the gepetto/homebrew-gepetto formular omniorbpy.rb 1, which installs omniorb in version 4.2.3. It seems to install something for python 2.7 as well. If that helps, here is the output
|
|
And this patch is still in robotpkg, to remove this I reported that here: https://www.omniorb-support.com/pipermail/omniorb-list/2019-May/032063.html and got an answer from the maintainer there: https://www.omniorb-support.com/pipermail/omniorb-list/2019-June/032067.html :
But I am not aware of any new released version on this 4_2 branch. @jviereck: I think you should either use a patched version as we do on robotpkg, or download a devel version on the svn upstream repository. I guess @jcarpent is the maintainer of gepetto/homebrew-gepetto, so he'll probably have answers for this. I have no skills on OSX yet ^^ |
@jviereck I've just patched it on brew and conda. Things should work fine now. |
I've pushed the fix to https://github.com/Gepetto/omniORBpy. Might be useful for other projects |
When reinstalling things for python3.8 I ran into this problem:
The previous problem with |
I can't reproduce on python 3.8 on Arch. Which version of omniORB do you have ? |
omniorb is at version 4.2.4 for me. If you cannot reproduce I guess we can close this bug. |
Hello, sorry for commenting here even though it has been 4 years, but since the issue hasn't been closed, I'll just write my question here. Currently I'm on Ubuntu 20, with Python 3.8. I have installed dpkg -l *omniidl*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-===============-============-======================================================
ii omniidl 4.2.2-0.9build4 amd64 omniORB IDL to C++ and Python compiler
ii omniidl-python 4.2.2-0.2build4 all omniidl backend to compile Python stubs from IDL files I've also built omniORB and omniORBpy from source, and I'm able to import them Python 3.8.20 (default, Sep 17 2024, 02:58:30)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import omniORB
>>> omniORB.__version__
'4.3.2'
>>> However, when I attempt to import gepetto, I will receive the error regarding a missing Python 3.8.20 (default, Sep 17 2024, 02:58:30)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gepetto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/gepetto/__init__.py", line 18, in <module>
from .color import Color # noqa: F401
File "/usr/local/lib/python3.8/site-packages/gepetto/color.py", line 20, in <module>
from .corbaserver import Color # noqa: F401
File "/usr/local/lib/python3.8/site-packages/gepetto/corbaserver/__init__.py", line 2, in <module>
from .gepetto import Error # noqa: F401
File "/usr/local/lib/python3.8/site-packages/gepetto/corbaserver/gepetto/__init__.py", line 9, in <module>
import gepetto.corbaserver.graphical_interface_idl
File "/usr/local/lib/python3.8/site-packages/gepetto/corbaserver/graphical_interface_idl.py", line 780, in <module>
_0_gepetto.corbaserver._objref_NodeCallback.selected.im_func.__doc__ = _0_gepetto.corbaserver.NodeCallback.selected__doc__
AttributeError: 'function' object has no attribute 'im_func'
>>> Is this due to the difference in versions between omniidl (4.2.2) and omniOrb (4.3.2)? |
Why don't you use binary packages instead of building from source ? |
Hi,
While trying to test #123 on 16.04 / python 3, with an omniORB 4.2.2 build for python 3, I got the following error:
This can be fixed with
sed -i 's/im_func.__doc__/__doc__/' graphical_interface_idl.py
The text was updated successfully, but these errors were encountered: