Issue deploying with robotpy

We have been trying to deploy our code to the robot, but whenever we do so, we get an interesting error we’re not able to debug.

We’ve tried uninstalling and reinstalling robotpy, updating pip, and syncing robotpy, but so far all solutions have had zero progress.

Traceback
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Scripts\robotpy.exe\__main__.py", line 7, in <module>
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Lib\site-packages\robotpy\main.py", line 261, in main
    _make_subcommands(parser, cmds, "command")
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Lib\site-packages\robotpy\main.py", line 193, in _make_subcommands
    obj = cmd_class(cmdparser)
          ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyfrc\mains\cli_sim.py", line 42, in __init__
    sim_ext_module = entry_point.load()
                     ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Lib\importlib\metadata\__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Lib\site-packages\xrp\__init__.py", line 1, in <module>
    from . import _init_xrp
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Lib\site-packages\xrp\_init_xrp.py", line 19, in <module>
    _lib = cdll.LoadLibrary(join(_root, "lib", "xrpVendordep.dll"))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Lib\ctypes\__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rhs.Robotics\AppData\Local\Programs\Python\Python312\Lib\ctypes\__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 127] The specified procedure could not be found```
1 Like

This looks like you’re running code that’s loading an XRP library. Are you trying to run on an XRP, or are you having trouble deploying to a roboRIO?

My guess is that you don’t have the correct visual studio runtimes installed, though I haven’t seen an error message that looks quite like that before. According to our documentation you need to have the VS 2019 runtime installed… but I believe it actually requires the VS 2022 redistributable installed (get it here).

If that doesn’t fix it, what version of Windows do you have, and please post the output of pip list.

We’ll be able to try this Thursday. The odd thing about this is we didn’t encounter this issue until very recently. My guess is our school district was messing with something which caused our installed files to get messed up. Hopefully re-installing the robotpy dependencies resolves this.

If you have the xrp package installed and don’t use it, then you can uninstall it and that will alleviate the issue too.

Hm. I have a different theory. Did you just recently install the 2025 beta, but previously had the 2024 stuff installed? If so, pip list will show a mix of things… and I bet that’s what’s the problem is. You need to ensure that only things from the same year are installed. Filed a bug at Limit entry points to a particular season · Issue #5 · robotpy/robotpy-cli · GitHub so we can fix it.

We upgraded to the 2025 beta around a month ago iirc, but we have tried uninstalling robotpy[all] and reinstalling all the 2025 stuff. Maybe the 2024 stuff wasn’t deleted for some reason, but I can check that when I get the chance.

We’ll try removing the xrp package and see if that resolves our issue.