仅使用Python 3且没有弄乱系统库的ROS旋律安装?

s.k*_*s.k 5 ubuntu boost ros

步骤和问题的描述:

我在那儿遵循安装指南:http :
//wiki.ros.org/melodic/Installation/Ubuntu

但:

  1. $ sudo apt-get install ros-melodic-desktop-full 不起作用:

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     ros-melodic-desktop-full : Depends: ros-melodic-perception but it is not going to be installed    
    E: Unable to correct problems, you have held broken packages.    
    
    Run Code Online (Sandbox Code Playgroud)

    ->问题1。

  2. $ sudo apt-get install ros-melodic-desktop-full似乎可以正常工作,但需要安装一整堆软件包(602 MB)-我希望这样做。详细查看这些软件包时,我可以看到:

    • 超过190种ros-something-packages:好的

    • 一些新的库:OK

    • 超过40个python-<packages>(绝对是Python 2软件包):->问题2.1

    • 大于80 libboost-<something-system-libraries>:->问题2.2

相关问题:

问题1:

你知道为什么吗?

问题2.1:

如何强制使用这些软件包的Python 3版本?

问题2.2:

为了其他目的,我从源代码构建了Boost(从Linux上的源代码构建Boost)。
因此,我担心如果我安装具有所有这些依赖关系的ros,则随附的boost系统库ros(均为boost版本1.65)会与我个性化的boost库(版本1.68)一起搞乱。希望编译其他软件(我更喜欢仅这些lib的一个版本;即最新的1.68)。
有没有办法告诉ros使用这些已经安装的库(基本上在中/usr/local/)?

一般信息:

我正在使用Ubuntu 18.04:4.15.0-43-generic x86_64 GNU/Linux Python 3版本是:3.6.7

小智 1

为了使 ROS 系统正常工作,它需要最低特定版本的依赖项。

您不能在安装中使用 python 3,因为所有工具都是用 python 2.7+ 制作的,但您可以通过更改为 3 来指定运行或编译包时使用的 python 版本ROS_PYTHON_VERSION

我认为您可以使用此答案将编译的源代码转换为.deb文件并将其安装,以防止 apt 干扰您的 boost 库

  • python 2 将“很快”被弃用;https://pythonclock.org。是时候升级恕我直言了。 (2认同)