r2b3 Failure to import _rclpy on windows
See original GitHub issueBug report
Required Info:
- Operating System:
- Windows 10 (Fresh install on a VM)
- Installation type:
- Version or commit hash:
- def304b4270b6b935b7d6fbbf7671634c2532452
- DDS implementation:
- Fast-RTPS
- Client library (if applicable):
- rclpy
Steps to reproduce issue
Symptom is a lot of errors when using ros2
command. This is after call C:\dev\ros2\local_setup.bat
C:\Users\osrf>ros2 --help
Failed to load entry point 'start': DLL load failed: The specified module could not be found.
Failed to load entry point 'status': DLL load failed: The specified module could not be found.
Failed to load entry point 'stop': DLL load failed: The specified module could not be found.
Failed to load entry point 'list': DLL load failed: The specified module could not be found.
Failed to load entry point 'call': DLL load failed: The specified module could not be found.
Failed to load entry point 'list': DLL load failed: The specified module could not be found.
Failed to load entry point 'echo': DLL load failed: The specified module could not be found.
Failed to load entry point 'list': DLL load failed: The specified module could not be found.
Failed to load entry point 'pub': DLL load failed: The specified module could not be found.
usage: ros2 [-h] Call `ros2 <command> -h` for more detailed usage. ...
ros2 is an extensible command-line tool for ROS 2.
optional arguments:
-h, --help show this help message and exit
Commands:
daemon Various daemon related sub-commands
msg Various msg related sub-commands
node Various node related sub-commands
pkg Various package related sub-commands
run Run a package specific executable
security Various security related sub-commands
service Various service related sub-commands
srv Various srv related sub-commands
topic Various topic related sub-commands
Call `ros2 <command> -h` for more detailed usage.
Trying to load one of the entry points shows a traceback when importing _rclpy
>>> from ros2cli.verb.daemon import start
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\dev\ros2\Lib\site-packages\ros2cli\verb\daemon\start.py", line 15, in <module>
from ros2cli.node.daemon import is_daemon_running
File "C:\dev\ros2\Lib\site-packages\ros2cli\node\daemon.py", line 22, in <module>
import rclpy
File "C:\dev\ros2\Lib\site-packages\rclpy\__init__.py", line 17, in <module>
from rclpy.executors import SingleThreadedExecutor as _SingleThreadedExecutor
File "C:\dev\ros2\Lib\site-packages\rclpy\executors.py", line 21, in <module>
from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy
File "C:\dev\ros2\Lib\site-packages\rclpy\impl\implementation_singleton.py", line 32, in <module>
rclpy_implementation = importlib.import_module('._rclpy', package='rclpy')
File "C:\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
Trying to import rclpy shows a similar error
>>> import rclpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\dev\ros2\Lib\site-packages\rclpy\__init__.py", line 17, in <module>
from rclpy.executors import SingleThreadedExecutor as _SingleThreadedExecutor
File "C:\dev\ros2\Lib\site-packages\rclpy\executors.py", line 21, in <module>
from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy
File "C:\dev\ros2\Lib\site-packages\rclpy\impl\implementation_singleton.py", line 32, in <module>
rclpy_implementation = importlib.import_module('._rclpy', package='rclpy')
File "C:\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
Expected behavior
I’d expect no ImportError to be raised.
Actual behavior
Import error is raised
Additional information
sys.path
>>> import sys
>>> sys.path
['', 'C:\\dev\\ros2\\Lib\\site-packages', 'C:\\Python36\\python36.zip', 'C:\\Python36\\DLLs', 'C:\\Python36\\lib', 'C:\\Python36', 'C:\\Python36\\lib\\site-packages']
Not sure if I should see _rclpy.dll or something like that, but I don’t. There is _rclpy.pyd
, is that what is failing to be found?
C:\Users\osrf>dir C:\dev\ros2\Lib\site-packages\rclpy
Volume in drive C has no label.
Volume Serial Number is AA39-7FB6
Directory of C:\dev\ros2\Lib\site-packages\rclpy
09/12/2017 09:38 AM <DIR> .
09/12/2017 09:38 AM <DIR> ..
09/12/2017 09:38 AM 3,527 callback_groups.py
09/12/2017 09:38 AM 3,126 client.py
09/12/2017 09:38 AM 646 constants.py
09/12/2017 09:38 AM 2,558 exceptions.py
09/12/2017 09:38 AM 16,545 executors.py
09/12/2017 09:38 AM 1,505 expand_topic_name.py
09/12/2017 09:38 AM <DIR> impl
09/12/2017 09:38 AM 2,535 logging.py
09/12/2017 09:38 AM 12,211 node.py
09/12/2017 09:38 AM 1,087 publisher.py
09/12/2017 09:38 AM 5,581 qos.py
09/12/2017 09:38 AM 1,449 service.py
09/12/2017 09:38 AM 1,270 subscription.py
09/12/2017 09:38 AM 2,157 timer.py
09/12/2017 09:38 AM 1,210 topic_or_service_is_hidden.py
09/12/2017 09:38 AM 1,203 utilities.py
09/12/2017 09:38 AM 1,709 validate_full_topic_name.py
09/12/2017 09:38 AM 1,568 validate_namespace.py
09/12/2017 09:38 AM 1,378 validate_node_name.py
09/12/2017 09:38 AM 1,710 validate_topic_name.py
09/12/2017 09:38 AM 1,716 _rclpy.lib
09/12/2017 09:38 AM 44,032 _rclpy.pyd
09/12/2017 09:38 AM 1,932 _rclpy_logging.lib
09/12/2017 09:38 AM 11,264 _rclpy_logging.pyd
09/12/2017 09:38 AM 1,654 __init__.py
09/12/2017 09:46 AM <DIR> __pycache__
24 File(s) 123,573 bytes
4 Dir(s) 6,535,761,920 bytes free
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Installation troubleshooting — ROS 2 Documentation: Foxy ...
Import failing without library present on the system . Sometimes rclpy fails to be imported because the expected C extension libraries are...
Read more >Creating custom msg and srv files — ROS 2 Documentation
Windows. colcon build --packages-select tutorial_interfaces ... "Failed to call service add_three_ints"); // CHANGE } rclcpp::shutdown(); return 0; }.
Read more >Colcon build fail, rclpy - python - Stack Overflow
Sometimes rclpy fails to be imported because the expected C extension libraries are not found. If so, compare the libraries present in the ......
Read more >rclpy Params Tutorial - Get and Set ROS2 Params with Python
Here's a minimal ROS2 Python node which declares 3 parameters (with no default value, we'll see later how to do that):. import rclpy....
Read more >Creating ROS 2 Actions - Foxglove
Once the goal succeeds or fails, the server sends back a service response ... import rclpy from rclpy.action import ActionServer from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would keep the logic simple and point to a single page / ticket which than provides enough information to guide the user further.
It needs to be handled in
rclpy
wrapping the line you referenced.