raulmur / ORB_SLAM2

Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities
Other
9.37k stars 4.69k forks source link

[rospack] Error: could not find python module 'rosdep2.rospack'. is rosdep up-to-date (at least 0.10.4)? #336

Closed archenroot closed 7 years ago

archenroot commented 7 years ago

I am on Gentoo system using standard ROS within Portage system (not custom overlay, etc.). When trying to execute ./build_ros.sh I get folowing error:

zangetsu@ares ~/proj/neural-networks/ORB_SLAM2 $ ./build_ros.sh 
Building ROS nodes
mkdir: adresář „build“ nelze vytvořit: Soubor již existuje
[rosbuild] Building package ORB_SLAM2
Failed to invoke /usr/bin/rospack deps-manifests ORB_SLAM2
[rospack] Error: could not find python module 'rosdep2.rospack'. is rosdep up-to-date (at least 0.10.4)?

CMake Error at /usr/share/ros/core/rosbuild/public.cmake:129 (message):

  Failed to invoke rospack to get compile flags for package 'ORB_SLAM2'.
  Look above for errors from rospack itself.  Aborting.  Please fix the
  broken dependency!

Call Stack (most recent call first):
  /usr/share/ros/core/rosbuild/public.cmake:207 (rosbuild_invoke_rospack)
  CMakeLists.txt:4 (rosbuild_init)

-- Configuring incomplete, errors occurred!
See also "/home/zangetsu/proj/neural-networks/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".
make: *** Nezadány žádné cíle a žádné makefily nenalezeny. Konec.

I reemerged python2_7 multiple times and Gentoo is pulling in Kinetic distribution.

Here are also my config variables available:

#ROS
export CMAKE_PREFIX_PATH=/usr
export PYTHONPATH=/usr/lib64/python2.7/site-packages/
export ROS_DISTRO=kinetic
export ROS_ETC_DIR=/usr/etc/ros
export ROS_MASTER_URI=http://ares:11311
export ROS_PACKAGE_PATH=/usr/share/ros_packages
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/zangetsu/proj/neural-networks/ORB_SLAM2/Examples/ROS
export ROS_ROOT=/usr/share/ros

I am using folowing version of rosdep:

zangetsu@ares ~/proj/neural-networks/ORB_SLAM2 $ rosdep --version
0.11.5

I am new to ROS, but here I have working roscore:

zangetsu@ares ~/proj/neural-networks/ORB_SLAM2 $ roscore
... logging to /home/zangetsu/.ros/log/9b2a311e-49e0-11e7-ba2b-48e244f51305/roslaunch-ares-887.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ares:35295/
ros_comm version 1.13.0

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.13.0

NODES

auto-starting new master
process[master]: started with pid [898]
ROS_MASTER_URI=http://ares:11311/

setting /run_id to 9b2a311e-49e0-11e7-ba2b-48e244f51305
process[rosout-1]: started with pid [911]
started core service [/rosout]

Any idea?

archenroot commented 7 years ago

Additionally I checked following site:

http://pydoc.net/Python/rosdep/0.11.4/rosdep2.rospack/

which refers to file rospack, so I checked the availability of this file on my system and found following:

zangetsu@ares ~/proj/neural-networks/ORB_SLAM2 $ locate rosdep2/rospack.py
/usr/lib64/python2.7/site-packages/rosdep2/rospack.py
/usr/lib64/python2.7/site-packages/rosdep2/rospack.pyc
/usr/lib64/python2.7/site-packages/rosdep2/rospack.pyo
/usr/lib64/python3.4/site-packages/rosdep2/rospack.py
zangetsu@ares ~/proj/neural-networks/ORB_SLAM2 $ diff /usr/lib64/python2.7/site-packages/rosdep2/rospack.py /usr/lib64/python3.4/site-packages/rosdep2/rospack.py
zangetsu@ares ~/proj/neural-networks/ORB_SLAM2 $ 

When I use:

zangetsu@ares ~/proj/neural-networks/ORB_SLAM2 $ pip list|grep rosdep
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
rosdep (0.11.5)

So strange, isn't it some error in the ORB_SLAM file?

archenroot commented 7 years ago

This was some issue with the ROS installation as we work now on Gentoo ros-overlay...-> quite experimental

keevindoherty commented 6 years ago

I recently had the same problem and spent a while trying to chase down the cause. For posterity, in my case it was caused by the use of Anaconda, and I was able to comment out the following line in my .bashrc (that added Anaconda to my path) to save the day:

# added by Anaconda2 installer
export PATH=PATH_TO_ANACONDA/bin:$PATH

where PATH_TO_ANACONDA is the the path to my Anaconda directory. If Anaconda is needed, I imagine swapping the order of the paths would probably do just as well.

rohitdavas commented 3 years ago

I found it to be issue due to anaconda environment. deactivating conda conda deactivate fixed the issue.

YFrisch commented 3 years ago

pip install rosdep to install rosdep into your anaconda env. instead of deactivating it

withnoerr commented 5 months ago

我的电脑里没有安装anaconda, 也遇到了同样的问题, 我找到了问题原因, 是由于电脑中同时存在多个版本的python, 所以需要将其他版本python删除掉, 重新运行make, 即可解决此问题 我是从这里得到的灵感https://github.com/raulmur/ORB_SLAM/issues/109