commands of catkin tools giving errors
Recently I installed catkin tools. I have ros (melodic) installed on my system (Ubuntu 18.04). The problem is that I can use catkin_init_workspace, but not catkin init. Using catkin_init or any of the commands of catkin tools gives me an error that asyncio is missing. So I installed asyncio using pip, but now I am getting this error:
Traceback (most recent call last):
File "/home/comp/.local/bin/catkin", line 11, in <module>
load_entry_point('catkin-tools==0.4.5', 'console_scripts', 'catkin')()
File "/home/comp/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/comp/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
return ep.load()
File "/home/comp/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load
return self.resolve()
File "/home/comp/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/home/comp/.local/lib/python2.7/site-packages/catkin_tools/commands/catkin.py", line 28, in <module>
from catkin_tools.common import is_tty
File "/home/comp/.local/lib/python2.7/site-packages/catkin_tools/common.py", line 24, in <module>
import asyncio
File "/home/comp/.local/lib/python2.7/site-packages/asyncio/__init__.py", line 9, in <module>
from . import selectors
File "/home/comp/.local/lib/python2.7/site-packages/asyncio/selectors.py", line 39
"{!r}".format(fileobj)) from None
^
SyntaxError: invalid syntax
Any help is appreciated!
EDIT :
I just made a directory with a src directory in it and ran :
catkin init
I get the above error. However catkin_init_workspace worked fine. If needed, these are the instructions I followed to install catkin tools -
https://catkin-tools.readthedocs.io/en/latest/installing.html
This is how I installed catkin tools -
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu lsb_release -sc
main" > /etc/apt/sources.list.d/ros-latest.list'
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install python-catkin-tools
This is the command I used to install asyncio:
pip install asyncio
EDIT 2:
I tried to install catkin tools from source (from the same website as earlier). I am still getting syntax errors, but different ones...
Commands I used:
$ git clone https://github.com/catkin/catkin_tool...
$ cd catkin_tools
$ pip install -r requirements.txt --upgrade
$ sudo python setup.py install --record install_manifest.txt
The first three commands work fine, the fourth one (sudo python setup.py install ...) gives these errors:
sudo python setup.py install --record install_manifest.txt
running install
running build
running build_py
running install_lib
byte-compiling /usr/local/lib/python2.7/dist-packages/catkin_tools/execution/executor.py to executor.pyc
File "/usr/local/lib/python2.7/dist-packages/catkin_tools/execution/executor.py", line 73
yield from lock
^
SyntaxError: invalid syntax
running install_data
running install_egg_info
running egg_info
writing requirements to catkin_tools.egg-info/requires.txt
writing catkin_tools.egg-info/PKG-INFO
writing top-level names to catkin_tools.egg-info/top_level.txt
writing dependency_links to catkin_tools.egg-info/dependency_links.txt
writing entry points to catkin_tools ...
post your code, please
I have posted what I have done @Procópio
how did you install
catkin_tools
? The file path in your traceback suggests you usedpip
.Could you explain why you used
pip
?So, I have updated exactly how I installed catkin tools...I don't think if I have used pip...please pardon me as I am a beginner..@gvdhoorn
Assuming you are using the system Python 2.x, why don't you use:
I would recommend to clean up the mess created by
sudo python setup.py install
(ie: uninstall it).If you must install things from sources, use
pip
to do it, so you have an easy way to uninstall.And you still haven't told us why you installed things from source.
It said that catkin tools was in beta...so I thought installing it from source might resolve the issue for me...I ran sudo apt-get remove python setup.py and installed catkin tools using sudo apt install python-catkin-tools .... but still I am getting this issue @gvdhoorn
I would strongly recommend to avoid building things from source, unless you have an absolute necessity.
Also: if you do, use tools which isolate these source builds (ie: don't run
sudo [..] install
), because that will contaminate your system with all sorts of files, and you don't know where they go.Did you clean out everything which was installed as part of your initial attempts from
/usr/local
? Those paths also appear in the traceback you show. You'll have to clean all that up. And/home/comp/.local
.I've just ran
docker run -ti --rm ros:melodic
and thenapt update && apt install python-catkin-tools
. Invokingcatkin
(ie: the base command) orcatkin config
on a workspace works for ...(more)@gvdhoorn, interesting, I'm not getting the same results even after pulling the latest docker image.