-
Notifications
You must be signed in to change notification settings - Fork 604
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
Python3 compatibility #158
Comments
So, I solved it by checking which version of Python is installed. Now, as you mentioned, there should probably something at the level of CMake: what if you have Python2 installed and want to build for Python 3 ? (not sure we want to support that), |
Yes I agree it would be better to have a boolean to determine if you want to compile with Python 2 or 3. I'm thinking it'd be better if it was a catkin flag, which is passed down to cmake. That way there'd be a ROS-wide flag of determining to compile with Python 2/3. |
Would it be possible to compile the version dependent part for both python 2 and 3 then use |
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Hey,
As is my understanding, ROS packages should aim to be python2 and python3 compatible. Currently on my system cv_bridge is linking against
libboost_python.so
though, which causes an issue for me since I am using a python3 interpreter andlibboost_python.so
is for python2 bindings (libboost_python3.so
is for python3 bindings). The issue seems to come from this line, which should befind_package(Boost REQUIRED python3)
in my case.However simply changing this to python3 will break python2 compatibility. Perhaps some option should be added to the CMakeLists.txt for choosing python3/python2.
Best regards,
Hans
The text was updated successfully, but these errors were encountered: