ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
0

Catkin insists on using em.py 3.4 and nosetests 3.4, when configured to use python 2.7

asked 2014-09-16 14:38:04 -0500

clauniel gravatar image

When I call catkin_make like this

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so

I see this in the output

-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Python nosetests: /usr/bin/nosetests-3.4
-- Using empy: /usr/lib/python3.4/site-packages/em.py

Naturally my build process fails because the python 2 executable cannot interpret these versions. How do I force catkin to use the python 2.7 versions?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2014-09-27 14:58:32 -0500

marauder gravatar image

Creating a symboilc link from the 2.7 to 3.4 package helped me. I know this is not a perfect solution,but it works for now.

ln -s /usr/lib/python2.7/site-packages/em.py /usr/lib/python3.4/site-packages/em.py

Hoping someone with a better knowledge could provide a more concrete solution

edit flag offensive delete link more

Comments

1

This is an option, but it also means you cannot use the 3.4 version for anything else anymore, right?

clauniel gravatar imageclauniel ( 2014-10-06 13:38:13 -0500 )edit

Yes, it does

marauder gravatar imagemarauder ( 2014-10-12 23:19:50 -0500 )edit
1

answered 2014-10-06 14:01:46 -0500

Dirk Thomas gravatar image

updated 2014-10-06 14:02:14 -0500

Please try setting the CMake variable PYTHON_VERSION to 2.7 or just 2. Using catkin_make you want to pass -DPYTHON_VERSION=2.7.

This will also figure out the PYTHON_EXECUTABLE automatically.

edit flag offensive delete link more

Comments

The python executable is being detected as the 2.7 version . But the em.py package is using the python 3 version no matter what the cmake variable is being set

marauder gravatar imagemarauder ( 2014-10-12 23:21:09 -0500 )edit
0

answered 2015-07-09 02:43:53 -0500

In my experience CMake can insist on using cached PYTHON_EXECUTABLE and NOSETESTS variables even if you set PYTHON_VERSION to something different.

Try removing build and devel directories before rebuilding:

rm -r build devel && catkin_make -DPYTHON_VERSION=2.7

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-09-16 14:37:13 -0500

Seen: 479 times

Last updated: Jul 09 '15