Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"OSError: [WinError 193] %1" When Running "ros2 run rqt_console rqt_console" #20

Closed
songyuc opened this issue Apr 28, 2020 · 15 comments
Closed

Comments

@songyuc
Copy link

songyuc commented Apr 28, 2020

Hi guys,
I am learning the ROS2 on Windows by the tutorials.
I meet an error "OSError: [WinError 193] %1" when running "ros2 run rqt_console rqt_console", and the detail output is:

Traceback (most recent call last):

File "E:\dev\ros2-eloquent\ros2-windows\Scripts\ros2-script.py", line 11, in
load_entry_point('ros2cli==0.8.7', 'console_scripts', 'ros2')()

File "E:\dev\ros2-eloquent\ros2-windows\Lib\site-packages\ros2cli\cli.py", line 69, in main
rc = extension.main(parser=parser, args=args)

File "E:\dev\ros2-eloquent\ros2-windows\Lib\site-packages\ros2run\command\run.py", line 72, in main
return run_executable(path=path, argv=args.argv, prefix=prefix)

File "E:\dev\ros2-eloquent\ros2-windows\Lib\site-packages\ros2run\api_init_.py", line 61, in run_executable
process = subprocess.Popen(cmd)

File "c:\python37\lib\subprocess.py", line 800, in init
restore_signals, start_new_session)

File "c:\python37\lib\subprocess.py", line 1207, in _execute_child
startupinfo)

OSError: [WinError 193] %1 is not a valid Win32 application.

I want to know how to solve this.
Any answer and idea will be appreciated!

@ahcorde
Copy link

ahcorde commented May 12, 2020

I compiled from sources Dashing, Eloquent and Foxy on Windows. This error exists in all of them.

WinError 193] %1 is not a valid Win32 application

Possible solution to this issue:

  • change the name of the executable to rqt_console_node.py. It seems that rqt_console.py is colliding with the package name
  • include the extension in the name I'm unable to launch it on windows without it.

If this is a possible workaround/fix, I can go ahead an fix all the packages suffering from this problem.

@ablasdel, any other thoughts about this issue ?

@dirk-thomas
Copy link
Contributor

I think the best approach to resolve this would be to convert the package to a Python package and use an entry point instead of the script.

@ivanpauno
Copy link

I think the best approach to resolve this would be to convert the package to a Python package and use an entry point instead of the script.

I agree that it's the best approach, but it doesn't seem to be backportable to Dashing and Eloquent if we want to fix that there too.

Having an ament function to generate something similar to console scripts entry points would be more backportable (ament/ament_cmake#213).

@dirk-thomas
Copy link
Contributor

but it doesn't seem to be backportable to Dashing and Eloquent if we want to fix that there too.

Can you clarify why you think that is the case?

@ivanpauno
Copy link

Can you clarify why you think that is the case?

Modifying the buildtype of a package isn't API compatible.
e.g.: after https://github.com/ros-visualization/rqt_shell/pull/11/files, it wouldn't be possible to do more:

find_package(rqt_shell)

P.S.: I understand that that isn't important to that package, and it can actually be fixed when changing the build type to ament_python. But API compatibility when changing the build type of a package doesn't sound obvious to me.

@dirk-thomas
Copy link
Contributor

Modifying the buildtype of a package isn't API compatible.

There is no rule for leaf packages like rqt plugins to require that kind of compatibility.

I have also never seen a rqt plugin which depends on another rqt plugin to find_package it. Why would it do that if both are Python plugins?

it can actually be fixed when changing the build type to ament_python.

Not sure what you mean with this?

@ivanpauno
Copy link

There is no rule for leaf packages like rqt plugins to require that kind of compatibility.

I have also never seen a rqt plugin which depends on another rqt plugin to find_package it. Why would it do that if both are Python plugins?

Yes, I agree. I don't imagine anybody doing that (though it was possible to do that before).

it can actually be fixed when changing the build type to ament_python.

Not sure what you mean with this?

I mean that installing a rqt_shellConfig.cmake doing something equivalent as before is still possible from an ament_python package.


In this case, it sounds like switching build type of the packages shouldn't affect users, so I withdraw my original comment.

@gusbots
Copy link

gusbots commented Nov 5, 2020

Hello guys,

I am also trying to learn ROS2 on Windows through the tutorials like @songyuc and I am facing the same issues to launch rqt_console.

I tried to follow the discussion here but it is very low level. So, for a person that just installed Foxy from the binaries. What would be the steps to fix this issue and run rqt_console?

@Abivishaq
Copy link

There is a similar discussion here:
https://answers.ros.org/question/350818/oserror-winerror-193-1-when-running-ros2-run-rqt_console-rqt_console/
It doesn't provide an exact solution but suggests a workaround using rqt.

@andrestoga
Copy link

Is there any progress in this issue?

@ivanpauno
Copy link

There are a bunch of PRs opened to address the issue, @ahcorde do you have time to follow-up on them?

@ahcorde
Copy link

ahcorde commented Jan 26, 2021

@ivanpauno I updated the two PR that you have reviewed. should I update the others too ?

@ivanpauno
Copy link

@ivanpauno I updated the two PR that you have reviewed. should I update the others too ?

Yes please, if you need a review in any of those feel free to tag me.

@wjwwood
Copy link
Member

wjwwood commented Apr 17, 2021

I think this was closed (for rqt_console which this issue is specifically about) in #21 and #28. So I'll close this.

@wjwwood wjwwood closed this as completed Apr 17, 2021
@hidmic
Copy link
Collaborator

hidmic commented Apr 19, 2021

Alright, all connected PRs have been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants