question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing python module fails, need to run catkin_make twice

See original GitHub issue

Somehow 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:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
DamKoVoshcommented, Nov 29, 2018

I can confirm the issue and workaround: ‘export CATKIN_SETUP_UTIL_ARGS=–extend’

0reactions
dirk-thomascommented, Jan 28, 2019

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - What happens when a module is imported twice?
Nothing, if a module has already been imported, it's not loaded again. You will simply get a reference to the module that has...
Read more >
python rostest fails to import python module - ROS Answers
Hello, I'm using ROS kinetic on an ubuntu 16.04 machine and have been trying to use rostest to run unit tests (and hopefully...
Read more >
ModuleNotFoundError in quiz of unit 6 - ROS Basics In 5 Days ...
I have a problem with the quiz for unit 6. The package contains all launch files, python scripts, and a message file.
Read more >
Error building ROS snapcraft when importing python libraries ...
Hi everyone. Currently I'm working on building a ROS application on a snap package. Previously, I had an installation rule problem with C++ ......
Read more >
ROS/ROS_Start.md · master · AV / AV Notes - MSU GitLab
When you want to run your own ROS packages (as opposed to the ... #!/usr/bin/env python import rospy # Required package for Python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found