ImportError: No module named catkin.environment_cache
I'm building on a MacBook Pro running Catalina 10.15.2.
I'm following the OSX build instructions here: https://wiki.ros.org/melodic/Installa...
I am at step 2.5.2 (Building the Catkin Workspace).
I provide the command:
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release -DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH=$HOME/ros_catkin_ws/install_isolated/lib
17 packages (of 54) install just fine, then I get the following error when building rosboost_cfg
:
-- BUILD_SHARED_LIBS is on
Traceback (most recent call last):
File "[$HOME]/melodic_catkin_ws/build_isolated/rosboost_cfg/catkin_generated/generate_cached_setup.py", line 20, in <module>
from catkin.environment_cache import generate_environment_script
ImportError: No module named catkin.environment_cache
CMake Error at [$HOME]/melodic_catkin_ws/install_isolated/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/usr/local/bin/python2
"[$HOME]melodic_catkin_ws/build_isolated/rosboost_cfg/catkin_generated/generate_cached_setup.py")
returned error code 1
Call Stack (most recent call first):
[$HOME]/melodic_catkin_ws/install_isolated/share/catkin/cmake/all.cmake:208 (safe_execute_process)
[$HOME]/melodic_catkin_ws/install_isolated/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:3 (find_package)
I have reviewed @mikepurvis work from a few years ago for catkin_tools
(https://github.com/catkin/catkin_tool...) and the associated PR (https://github.com/catkin/catkin_tool...).
I'm having the problem with catkin_make_isolated
, however, and am unsure how I could apply the changes from catkin_tools
.
I think I'm having the same mutex problems as those previously reported:
If I run catkin_make_isolated
with --only-pkg-with-deps=rosboost_cfg
, it builds catkin
and rosboost_cfg
without any problems.
I then attempt to run catkin_make_isolated
with --ignore-pkg=rosboost_cfg
and it eventually chokes with ImportError: No module named catkin.environment_cache
on rosbuild
.
I attempt the same process on rosbuild
(i.e., --only-pkg-with-deps=rosbuild
), but there are enough dependencies there that I eventually get ImportError: No module named catkin.environment_cache
while processing one of the dependencies.
What do the following commands output:
python --version
andpython -c "import catkin_pkg; print(catkin_pkg.__version__)"
?python --version
is Python 3.7.5.python -c "import catkin_pkg; print(catkin_pkg.__version__)"
is 0.4.16.My Python symlink should be to 2.7. I changed it (now reporting Python 2.7.16). I reran the
rosdep
commands and then rebuild the workspace. It worked.I still had to
brew install lz4
.I can convert this into an answer, unless you want to flesh it out with some detail about why I got the error consistently for certain packages with Python 3, and why it was partially fixed by only building the offending package and its dependencies. It might not help anyone, but I am curious...
Thanks again for the help.