在单独的Anaconda环境下在MacOS上安装ROS Kinetic

时间:2018-02-24 06:28:29

标签: python macos macos-sierra ros

我正在Python Anaconda发行版的单独环境下在MacOS Sierra 10.12.6上安装ROS Kinetic。

这是我的python版本(我在Anaconda中的单独python环境称为“ros-kinetic”):

(ros-kinetic)  jizhe@jizhedeMacBook-Pro  ~/ros_catkin_ws  python --version
Python 3.6.4 :: Anaconda, Inc.

我按照指南:http://wiki.ros.org/kinetic/Installation/OSX/Homebrew/Source

当我执行“rosdep install”命令时,出现以下错误:

(ros-kinetic)  jizhe@jizhedeMacBook-Pro ~/ros_catkin_ws  rosdep install --from-paths src --ignore-src --rosdistro kinetic -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
actionlib: No definition of [python-wxtools] for OS [osx]
catkin: No definition of [google-mock] for OS [osx]
roslisp: No definition of [google-mock] for OS [osx]

显然,包“python-wxtools”和“google-mock”有问题。

我已经通过“brew install wxpython”安装了wxpython,这里是wxpython信息:

(ros-kinetic)  jizhe@jizhedeMacBook-Pro  ~/ros_catkin_ws  brew info wxpython
wxpython: stable 3.0.2.0 (bottled)
Python bindings for wxWidgets
https://www.wxwidgets.org/
/usr/local/Cellar/wxpython/3.0.2.0_1 (1,108 files, 37.9MB) *
  Poured from bottle on 2018-02-24 at 03:56:21
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/wxpython.rb
==> Dependencies
Required: wxmac ✔
==> Caveats
Python modules have been installed and Homebrew's site-packages is not
in your Python sys.path, so you will not be able to import the modules
this formula installed. If you plan to develop with these modules,
please run:
mkdir -p /Users/jizhe/Library/Python/2.7/lib/python/site-packages
  echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/jizhe/Library/Python/2.7/lib/python/site-packages/homebrew.pth

我已经运行了命令:

$ mkdir -p ~/Library/Python/2.7/lib/python/site-packages
$ echo "$(brew --prefix)/lib/python2.7/site-packages" >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth

那么,包“google-mock”和“python-wxtools”有什么问题,我该如何解决这个问题呢?

3 个答案:

答案 0 :(得分:4)

尝试使用--skip-keys安装python-wxtools --skip-keys google-mock。它对我有用。

答案 1 :(得分:2)

此问题有a ticket。基本上解决方法是手动安装googletest。不确定python-wxtools有什么问题。

编辑:如果您使用的是ros-install-osx,则可以将以下行添加到rosdeps.yaml文件中:

google-mock:
  osx:
    homebrew:
      packages: []

答案 2 :(得分:0)

我从 Google 搜索中发现了这个问题,仅供参考,2021 年在 macOS 上的 conda 中安装 ROS 应该非常简单,请参阅以下链接: