I don't know why the apt installation of rospkg removes existing packages, but the same happened to me. What works, actually, is to create a virtual machine with python3 interpreter (virtualenv -p /usr/bin/python3, for example) and under it run pip install rospkg).
(additionally, you'd have to run pip install catkin_pkg, in order to run python3 scripts. I can confirm this approach works for basic ROS functionality - establishing nodes, publishing and subscribing to topics etc.However, there are packages that don't work with python3. In order to combine both - scripts that have to use python3 and those that have to use python2, I define in the shebang the interpreter to use, e.g. #!/home/bot/virtualEnvs/v3/bin)
Originally posted by gavran with karma: 526 on 2016-04-19
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by joq on 2016-04-20:
The problem is that many ROS Python packages install different versions under the same file name, so the python3-foo-bar
package has to "Conflict" with the corresponding python-foo-bar
.
Comment by ravijoshi on 2020-01-12:
I followed these steps but couldn't make it work. I posted my question here. Could you please write down these steps from the beginning? Do I just need to run these two commands virtualenv -p /usr/bin/python3 myenv
and under myenv
run pip install rospkg
?