<div dir="ltr">I recently had reason to try to install cppyy using Python 3 and pip. With the use of the wheels for cppyy-cling the process went smoothly enough until pip tried to build <a href="https://pypi.python.org/pypi/cppyy-backend/0.2.0">cppyy-backend</a>. Building this package by itself results in the following error message;<div><br></div><div><div><font face="monospace, monospace">$ python3 setup.py build</font></div><div><font face="monospace, monospace">running build</font></div><div><font face="monospace, monospace">running build_ext</font></div><div><font face="monospace, monospace">x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ib'/usr/local/lib/python3.5/dist-packages/cppyy_backend/include' -I/usr/include/python3.5m -c src/clingwrapper.cxx -o build/temp.linux-x86_64-3.5/src/clingwrapper.o -std=c++11 -O2</font></div><div><font face="monospace, monospace">cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++</font></div><div><font face="monospace, monospace">In file included from src/clingwrapper.cxx:4:0:</font></div><div><font face="monospace, monospace">src/callcontext.h:11:20: fatal error: Rtypes.h: No such file or directory</font></div><div><font face="monospace, monospace">compilation terminated.</font></div><div><font face="monospace, monospace">error: command 'x86_64-linux-gnu-gcc' failed with exit status 1</font></div></div><div><br></div><div>A careful look at the command line argument for gcc reveals a mangled include argument, <font face="monospace, monospace">-Ib'/usr/local/lib/python3.5/dist-packages/cppyy_backend/include'</font>. This is a binary literal string introduced by the output of a system call, "cling-config --cppflags". The functions in the subprocess module return 'bytes' objects in Python 3. In this case the return value from 'check_output' was appended wholesale into the 'include_dirs' argument of your extension, and the representation thereof was used in turn to build the function call to gcc. (The representation being a binary literal string)</div><div><br></div><div>To fix this the bytes object returned by subprocess.check_output needs to be decoded to either 'utf-8' or 'ascii', preferably the former as Python 3 uses unicode literals. This can be accomplished by appending '.decode("utf-8")' to line 28;</div><div><br></div><div><div><font face="monospace, monospace">--- /home/parker/Documents/cppyy/cppyy-backend-0.2.0/setup.py<span style="white-space:pre">  </span>Fri Sep 22 12:25:29 2017</font></div><div><font face="monospace, monospace">+++ /home/parker/Documents/cppyy/cppyy-backend-0.2.0/setup.py.patched<span style="white-space:pre">  </span>Tue Sep 26 19:37:50 2017</font></div><div><font face="monospace, monospace">@@ -25,7 +25,7 @@</font></div><div><font face="monospace, monospace">     if root_install:</font></div><div><font face="monospace, monospace">         return os.path.join(root_install, 'include')</font></div><div><font face="monospace, monospace">     cli_arg = subprocess.check_output(['cling-config', '--cppflags'])</font></div><div><font face="monospace, monospace">-    return cli_arg[2:-1]</font></div><div><font face="monospace, monospace">+    return cli_arg[2:-1].decode("utf-8")</font></div><div><font face="monospace, monospace"> </font></div><div><font face="monospace, monospace"> class my_build_cpplib(_build_ext):</font></div><div><font face="monospace, monospace">     def build_extension(self, ext):</font></div></div><div><br></div><div>With this patch pip will be able to build the cppyy-backend package from source on Python 2 or 3, and pip installing cppyy will not require user intervention.</div><div><br></div><div>P.S. The "Comments and Bugs" section of the cppyy docs directs the reader to a repository with issue tracking turned off, which is why you're getting this email instead.</div></div>