Importing python module fails, need to run catkin_make twice
See original GitHub issueSomehow related to https://github.com/ros/catkin/issues/841 yet I am not sure if entirely the same.
I created a minimal example here: https://github.com/agutenkunst/bug_python_test_deps
If I start with a clean workspace and do
catkin_make
catkin_make run_tests_bug_python_test_deps_rostest_test_foo_test.test
it will fail with ImportError: No module named bug_python_test_deps.foo
If I now do a touch build/CMakeCache.txt
and run the test again with
catkin_make run_tests_bug_python_test_deps_rostest_test_foo_test.test
everything works fine.
Printing the pythonpath inside my test yields that at the second run a additional /home/[username]/catkin_ws/devel/lib/python2.7/dist-packages appears in the path, which is exactly the missing location in the first run.
Is there something that I didn’t get correct?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
I can confirm the issue and workaround: ‘export CATKIN_SETUP_UTIL_ARGS=–extend’
I created #986 which addresses the originally reported problem from @agutenkunst for me.
@agutenkunst Please give it a try with the patch and comment if it resolves the problem for you to. @TheDash Please also try the proposed patch for your use case (which I couldn’t try since the steps to reproduce are unclear).