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

catkin_tools : "Import error: no module named asyncio"

asked 2020-04-04 09:40:52 -0600

sush3009 gravatar image

updated 2022-05-23 09:55:07 -0600

lucasw gravatar image

Hi, I have recently installed ROS Melodic on Windows. Initially, I was getting an error that catkin is not a recognized command. So I downloaded catkin_tools from its official documentation. After downloading, I have been getting this error: "Import error: No module named asyncio" whenever I use any catkin command. I searched online and asyncio is a Python 3.3+ command. But the standard installation procedure (given on the ROS website) downloads Python2.7amd64 files. How do I sort this issue

I am running a Windows 10 Home 64-bit machine. Python version: Python 2.7.15 ROS: ROS (1) Melodic (I have downloaded the full desktop version)

C:\opt\ros\melodic\x64>catkin configure
Traceback (most recent call last):
  File "C:\opt\python27amd64\Scripts\catkin-script.py", line 11, in <module>
    load_entry_point('catkin-tools==0.4.5', 'console_scripts', 'catkin')()
  File "C:\opt\python27amd64\lib\site-packages\pkg_resources\__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "C:\opt\python27amd64\lib\site-packages\pkg_resources\__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "C:\opt\python27amd64\lib\site-packages\pkg_resources\__init__.py", line 2443, in load
    return self.resolve()
  File "C:\opt\python27amd64\lib\site-packages\pkg_resources\__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "C:\opt\python27amd64\lib\site-packages\catkin_tools\commands\catkin.py", line 28, in <module>
    from catkin_tools.common import is_tty
  File "C:\opt\python27amd64\lib\site-packages\catkin_tools\common.py", line 24, in <module>
    import asyncio
ImportError: No module named asyncio
edit retag flag offensive close merge delete

Comments

This is the image of the screen showing the error

Do not post screenshots of terminals / Window's cmd windows.

It's all text, so copy-paste it into your question, and then format it correctly, using the Preformatted Text button (the one with 101010 on it).

For now I'll close your question, as it doesn't follow the support guidelines.

If you edit your question and replace the screenshot with a verbatim copy of the terminal text, we can re-open.

Use the edit button/link for this.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-04 12:11:41 -0600 )edit

I have done the suggested edits. Please reopen the question

sush3009 gravatar image sush3009  ( 2020-04-05 01:35:27 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-04-07 14:47:28 -0600

OoeyGUI gravatar image

What was the specific text of the original problem you were hitting? (catkin_tools isn't something that's been specifically enabled on windows.)

When you created the command line, did you add or call c:\opt\ros\melodic\x64\setup.bat?

edit flag offensive delete link more

Comments

Before installing catkin_tools from the official documentation, on using commands like catkin build and catkin configure, cmd showed the error that catkin was not recognized as an internal or external command.

Yes, I added the setup.bat file while configuring the workspace.

The problem is I can use catkin_make but cannot use commands like catkin build or catkin configure which belong to catkin_tools because of which I had to install catkin_tools from this link (https://catkin-tools.readthedocs.io/e...). But now running commands like catkin build and catkin configure gives me this asyncio error which I have described in the question.

sush3009 gravatar image sush3009  ( 2020-04-08 03:02:51 -0600 )edit
0

answered 2020-04-06 09:26:43 -0600

electrophod gravatar image

updated 2020-04-06 09:27:35 -0600

Install the 'asyncio' python package using pip on your system

for that run the command pip install asyncio in your command prompt.

edit flag offensive delete link more

Comments

Doing that gives me the following error:

ERROR: Command errored out with exit status 1: 'c:\opt\python27amd64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\sushrut\\appdata\\local\\temp\\pip-install-9jly1n\\asyncio\\setup.py'"'"'; __file__='"'"'c:\\users\\sushrut\\appdata\\local\\temp\\pip-install-9jly1n\\asyncio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'c:\users\sushrut\appdata\local\temp\pip-record-mswsw8\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\opt\python27amd64\Include\asyncio' Check the logs for full command output

A solution to this problem suggested changing the default version of python to Python 3.3+. But the standard ROS installation is itself downloading Python 2.7, hence changing the default in cmd is different from changing it in ROS.

sush3009 gravatar image sush3009  ( 2020-04-06 10:41:24 -0600 )edit

The thing I don't understand is this: ROS-Melodic runs on Python27 but the catkin tools need Python 3.3+ for running. How is it possible then to do so?

sush3009 gravatar image sush3009  ( 2020-04-06 11:53:38 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2020-04-04 09:40:52 -0600

Seen: 3,255 times

Last updated: Apr 07 '20