ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

rosversion error when trying to run roscore

asked 2018-08-28 12:58:21 -0600

cfk gravatar image

updated 2018-08-29 03:44:40 -0600


when I try to run the roscore or start my project launch file I get the following error:

... logging to /home/nvidia/.ros/log/1c5e18a0-aae7-11e8-8e0e-00044b8d24bd/roslaunch-tegra-ubuntu-30432.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.

Traceback (most recent call last):
   File "/usr/local/bin/rosversion", line 7, in <module>
     from rospkg.rosversion import main
ImportError: No module named rosversion
Invalid <param> tag: Cannot load command parameter [rosversion]: command [rosversion roslaunch] returned with code [1].

Param xml is <param command="rosversion roslaunch" name="rosversion"/>
The traceback for the exception was written to the log file

The ROS environment variables command env | grep ROS gives me the following:


The rosversion -d command gives me the same error but actually on ROS Kinetic (edited from "Hydro 1.12.13"). The strange thing is, I did not change anything ROS related and it worked correctly before the strange error. It seems there is a problem with the rosversion-file but it contains the following code:


# -*- coding: utf-8 -*-
import re
import sys

from rospkg.rosversion import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])

I'm grateful for any help!

edit retag flag offensive close merge delete



Hydro? Is this a special deployment on an old platform? Why does your ROS_ROOT say /opt/ros/kinetic?

gvdhoorn gravatar image gvdhoorn  ( 2018-08-28 14:47:57 -0600 )edit

Sorry that was a stupid mistake. I checked my documents where I wrote down an older version of my system. Of couse I'm on ROS Kinetic.

cfk gravatar image cfk  ( 2018-08-29 03:35:49 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-08-28 14:51:47 -0600

gvdhoorn gravatar image
File "/usr/local/bin/rosversion"

this line seems to suggest you have a pip installed version of python-rospkg.

It could be that updated packages have been released, but since your /usr/local version is always taken instead of the regular one, you're still running the pip installed version.

The currently released rosversion file for Kinetic (in /usr/bin) starts with this (after the license block):

from __future__ import print_function

import os
import sys
import traceback

import rospkg
from rospkg.common import PACKAGE_FILE
from rospkg.rospack import ManifestManager

edit flag offensive delete link more

answered 2018-08-29 04:15:50 -0600

cfk gravatar image

In fact, I updated the pip version before. I tried to downgrade to an older pip version. But this led to an error in following this updating rospkg instructions. It seems there are different interpreter in several paths, therefore I could not use sudo pip install --upgrade pip afterwards.

Nevertheless sudo easy_install -U rospkg refering to this post solved my problem, even if it is not recommended to use easy_install for updating rospkg anymore. So it was more a a rospkg issue than a pip error.

Thanks guys!

edit flag offensive delete link more



Anything other than using apt on a Debian or Ubuntu platform is strongly disrecommended for installing ROS (Python) packages. I would recommend to remove all pip and easy_install installed pkgs and rely on the debian pkgs only, unless you have a very strong need to do otherwise.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-29 04:18:50 -0600 )edit

Question Tools


Asked: 2018-08-28 12:58:21 -0600

Seen: 2,128 times

Last updated: Aug 29 '18