Skip to content
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

TypeError: No registered converter was able to produce a C++ rvalue ... #49

Closed
mihahauke opened this issue Apr 30, 2016 · 11 comments
Closed

Comments

@mihahauke
Copy link
Collaborator

from Csaba Zsolnai on google groups
"
i have some trouble making the basic example run after building vizdoom.
I get the following error:

python basic.py

Traceback (most recent call last):
File "basic.py", line 13, in
from vizdoom import DoomGame
TypeError: No registered converter was able to produce a C++ rvalue of type std::string from this Python object of type str

I am running Ubuntu 15.10 64 bit

"

@wjaskowski
Copy link
Collaborator

A possible hint: libavg/libavg#728

@mihahauke
Copy link
Collaborator Author

Turns it's probably some boost version's bug.

@wjaskowski
Copy link
Collaborator

Shouldn't we then increase the boost version requirement to 1.59?

On 5 May 2016 at 10:20, Michał Kempka notifications@github.com wrote:

Turns it's probably some boost version's bug.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#49 (comment)

@mihahauke
Copy link
Collaborator Author

I thought about this but I was not fully convinced. The link you provided earlier refers to boost 1.60...

@wjaskowski
Copy link
Collaborator

OK. Indeed, on my boost 1.58, it works without problems.

On 5 May 2016 at 10:46, Michał Kempka notifications@github.com wrote:

I thought about this but I was not fully convinced. The link you provided
earlier refers to boost 1.60...


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#49 (comment)

@mihahauke
Copy link
Collaborator Author

Hmmm the person which shared this issue also had 1.58 version so maybe it's not about the version but some installation error.

@wjaskowski
Copy link
Collaborator

Right. That is what I meant.

On 5 May 2016 at 10:58, Michał Kempka notifications@github.com wrote:

Hmmm the person which shared this issue also had 1.58 version so maybe
it's not about the version but some installation error.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#49 (comment)

@wjaskowski
Copy link
Collaborator

This problem is still there and it is related to g++ version. I have boost 1.58 (Ubuntu 15.10) and I get this (runtime) error when using g++ 4.8.4. But it works flawlessly on g++ 5.2.1. (And this is serious because we do need g++ 4.8.4 since CUDA does not work on gcc>=4.9)

@wjaskowski wjaskowski reopened this May 6, 2016
@mihahauke
Copy link
Collaborator Author

Are you sure? I have g++ 4.8.5 and it works ok.

@wjaskowski
Copy link
Collaborator

wjaskowski commented May 6, 2016 via email

@mwydmuch
Copy link
Collaborator

mwydmuch commented May 7, 2016

After a bit of testing I can confirm that there are problem with rvalue and lvalue conversion between Python str type and std::string when compiling with gcc version lower then 5.
Unfortunately I have not found the reasonable cause of this problem (I also dug through Boost.Python docs).

So I've added workaround -> conversion from Python str to cstring and then from cstring to std::string.
It isn't elegant but at the moment probably the simplest solution.

(Tested on gcc 4.7, 4.8, 4.9, 5, 6)

@mwydmuch mwydmuch closed this as completed May 7, 2016
akolishchak pushed a commit to akolishchak/ViZDoom that referenced this issue May 27, 2018
funkey added a commit to funkey/pylp that referenced this issue Sep 6, 2018
There is a bug for a particular combination of gcc and boost that does
not correctly register a converter from a python str to std::string [1].
Unfortunately, this combination is used by a default conda installation.
The easiest for now is to get rid of the string conversion.

[1] Farama-Foundation/ViZDoom#49
funkey added a commit to funkey/pylp that referenced this issue Sep 7, 2018
This is a workaround for a bug triggered by the combination of boost/gcc
used in conda (Farama-Foundation/ViZDoom#49).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants