解决:rospack depends 报错: could not find python module 'rosdep2.rospack'. is rosdep up-to-date

  这个问题全部如下:

 

Traceback (most recent call last):
  File "/home/suli/.local/lib/python2.7/site-packages/rosdep2/__init__.py", line 40, in
    from .installers import InstallerContext, Installer, \
  File "/home/suli/.local/lib/python2.7/site-packages/rosdep2/installers.py", line 36, in
    from rospkg.os_detect import OsDetect
  File "/home/suli/.local/lib/python2.7/site-packages/rospkg/__init__.py", line 41, in
    from .manifest import InvalidManifest, Manifest, parse_manifest_file
  File "/home/suli/.local/lib/python2.7/site-packages/rospkg/manifest.py", line 40, in
    import xml.dom.minidom as dom
  File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 22, in
    from xml.dom.xmlbuilder import DOMImplementationLS, DocumentLS
  File "/usr/local/lib/python2.7/xml/dom/xmlbuilder.py", line 3, in
    import copy
  File "/usr/local/lib/python2.7/copy.py", line 52, in
    import weakref
  File "/usr/local/lib/python2.7/weakref.py", line 14, in
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Traceback (most recent call last):
  File "/home/suli/.local/lib/python2.7/site-packages/rosdep2/__init__.py", line 40, in
    from .installers import InstallerContext, Installer, \
  File "/home/suli/.local/lib/python2.7/site-packages/rosdep2/installers.py", line 36, in
    from rospkg.os_detect import OsDetect
  File "/home/suli/.local/lib/python2.7/site-packages/rospkg/__init__.py", line 41, in
    from .manifest import InvalidManifest, Manifest, parse_manifest_file
  File "/home/suli/.local/lib/python2.7/site-packages/rospkg/manifest.py", line 40, in
    import xml.dom.minidom as dom
  File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 22, in
    from xml.dom.xmlbuilder import DOMImplementationLS, DocumentLS
  File "/usr/local/lib/python2.7/xml/dom/xmlbuilder.py", line 3, in
    import copy
  File "/usr/local/lib/python2.7/copy.py", line 52, in
    import weakref
  File "/usr/local/lib/python2.7/weakref.py", line 14, in
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
[rospack] Error: could not find python module 'rosdep2.rospack'. is rosdep up-to-date (at least 0.10.4)?

 

之前一直以为是rosdep那块出的问题,所以各种更新rosdep,但问题依然在,后来开始觉得是python的路径有问题,不过原谅我linxu真的菜如狗,试了一种方法后,没成功就放弃了。。。然后偶然看到一个说解决ImportError: cannot import name _remove_dead_weakref的帖子,将python切换为切回系统自带python(原文链接https://xs3c.co/archives/562),方法为

                                                export PATH=/usr/bin:$PATH

之后再执行rospack depends时就ok了。。。

你可能感兴趣的:(ROS,机器学习,python)