ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
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 -0600

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 -0600

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 image clauniel  ( 2014-10-06 13:38:13 -0600 )edit

Yes, it does

marauder gravatar image marauder  ( 2014-10-12 23:19:50 -0600 )edit
1

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

Dirk Thomas gravatar image

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

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 image marauder  ( 2014-10-12 23:21:09 -0600 )edit
0

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

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

Question Tools

2 followers

Stats

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

Seen: 828 times

Last updated: Jul 09 '15