Error when Deploying the Robot - Robotpy

Just recently, my team has run into problems when deploying our robot. Running the command ‘python -m robotpy deploy’ no longer works. Since our last successful deploy, we have not edited anything other than robot.py and maybe another component. here is the error we receive when attempting to deploy:

$ python -m robotpy deploy
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in run_code
File "C:\Users\kmott\AppData\Local\Programs\Python\Python312\Lib\site-packages\robotpy_main
.py", line 4, in
main()
File “C:\Users\kmott\AppData\Local\Programs\Python\Python312\Lib\site-packages\robotpy\main.py”, line 314, in main
retval = subcommand.run(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\kmott\AppData\Local\Programs\Python\Python312\Lib\site-packages\robotpy_installer\utils.py”, line 170, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
TypeError: Deploy.run() missing 13 required positional arguments: ‘skip_tests’, ‘debug’, ‘nc’, ‘nc_ds’, ‘ignore_image_version’, ‘no_install’, ‘no_verify’, ‘no_uninstall’, ‘force_install’, ‘large’, ‘robot’, ‘team’, and ‘no_resolve’

Any help would be appreciated, Thank You!

Do you have a link to your code?

GitHub - km-otternauts-6758/robot-2024 here you go.

That seems like it should work. What’s the output of python -m pip list?

$ python -m pip list
Package Version


attrs 23.2.0
bcrypt 4.1.2
cffi 1.16.0
colorama 0.4.6
coverage 7.4.1
cryptography 41.0.7
iniconfig 2.0.0
jsonschema 4.21.1
jsonschema-specifications 2023.12.1
numpy 1.26.3
opencv-python 4.9.0.80
packaging 23.2
paramiko 3.4.0
phoenix6 24.1.0
Pint 0.23
pip 24.0
pluggy 1.3.0
pycparser 2.21
pyfrc 2024.0.1
PyNaCl 1.5.0
pynetconsole 2.0.4
pyntcore 2024.2.1.2
pyproject-toml 0.0.10
pytest 7.4.4
pytest-reraise 2.1.2
referencing 0.33.0
robotpy 2024.2.1.1
robotpy-apriltag 2024.1.1.1
robotpy-cli 2024.0.0
robotpy-commands-v2 2024.0.0b4
robotpy-cscore 2024.1.1.1
robotpy-ctre 2024.1.1
robotpy-hal 2024.2.1.2
robotpy-halsim-ds-socket 2024.1.1.1
robotpy-halsim-gui 2024.2.1.2
robotpy-halsim-ws 2024.1.1.1
robotpy-installer 2024.2.0
robotpy-navx 2024.1.0
robotpy-pathplannerlib 2024.1.3
robotpy-rev 2024.2.0
robotpy-romi 2024.1.1.1
robotpy-wpilib-utilities 2024.0.0
robotpy-wpimath 2024.2.1.2
robotpy-wpinet 2024.2.1.2
robotpy-wpiutil 2024.2.1.2
robotpy-xrp 2024.1.1.1
rpds-py 0.17.1
setuptools 69.0.3
toml 0.10.2
tomli 2.0.1
typing_extensions 4.9.0
wheel 0.42.0
wpilib 2024.2.1.2

That’s really strange. I think I would recommend uninstalling/reinstalling these two packages:

python -m pip uninstall robotpy-cli robotpy-installer
python -m pip install robotpy-cli robotpy-installer

If that doesn’t address it, I can write a script to try to figure out why it’s breaking in your environment, since it seems to work everywhere else.

Which exact version of Python are you using? I see it’s 3.12, but 3.12.what?

We are using Python 3.12.2

Running these two commands did not work when we tried to re-deploy the robot.

Do any of the other commands work, or is it just deploy that’s broken? If you do python -m robotpy, it shows a bunch of other commands you can execute. For example, python -m robotpy sim

trying other commands like ‘python -m robotpy test’ returns similar errors.

‘python -m robotpy sim’ returns a different error:

17:07:03:185 INFO : halsim_gui : WPILib HAL Simulation 2024.2.1.2
HAL Extensions: Attempting to load: halsim_gui
Simulator GUI Initializing.
Simulator GUI Initialized!
HAL Extensions: Successfully loaded extension
17:07:03:284 ERROR : pyfrc.physics : User physics module does not have a PhysicsEngine object

I tried Python 3.12.2 on Windows and wasn’t able to reproduce your error, so it must be something weird about your environment. Feels likely that something got corrupted during upgrades, but it’s hard to say what. pip is… challenging to work with sometimes.

More curiosity, does python -m robotpy deploy --help show a bunch of different arguments or nothing?

Here’s a script – if you could run it then that’ll tell me a bunch about your environment and see what we’re missing.

import argparse
import importlib.metadata
import inspect
import sys

for ep in importlib.metadata.entry_points(group="robotpy"):
    if ep.name == "deploy":
        cmd_class = ep.load()
        print("cmd_class", cmd_class)
        break
else:
    print("ERROR")
    sys.exit(1)

parser = argparse.ArgumentParser()
cmd = cmd_class(parser)

#
# parser.print_help()

signature = inspect.Signature.from_callable(cmd.run)
for k, v in dict(signature.parameters).items():
    print(f"k={k} v={v} kind={v.kind}")

After you run that, if you could paste the output here that would be great. You don’t need to be connected to your robot to run it.

Finally, I think it’s an environmental problem, so I would force pip to reinstall everything. You could manually uninstall all your packages, but that sounds annoying. I would start with python -m pip install --force-reinstall -U robotpy and see if that addresses it.

“python -m robotpy deploy --help” returns the correct message.

Here is what your script returned:

$ python -m robotpy deploy
cmd_class <class ‘robotpy_installer.cli_deploy.Deploy’>
k=main_file v=main_file: pathlib.Path kind=POSITIONAL_OR_KEYWORD
k=project_path v=project_path: pathlib.Path kind=POSITIONAL_OR_KEYWORD
k=robot_class v=robot_class kind=POSITIONAL_OR_KEYWORD
k=builtin v=builtin: bool kind=POSITIONAL_OR_KEYWORD
k=skip_tests v=skip_tests: bool kind=POSITIONAL_OR_KEYWORD
k=debug v=debug: bool kind=POSITIONAL_OR_KEYWORD
k=nc v=nc: bool kind=POSITIONAL_OR_KEYWORD
k=nc_ds v=nc_ds: bool kind=POSITIONAL_OR_KEYWORD
k=ignore_image_version v=ignore_image_version: bool kind=POSITIONAL_OR_KEYWORD
k=no_install v=no_install: bool kind=POSITIONAL_OR_KEYWORD
k=no_verify v=no_verify: bool kind=POSITIONAL_OR_KEYWORD
k=no_uninstall v=no_uninstall: bool kind=POSITIONAL_OR_KEYWORD
k=force_install v=force_install: bool kind=POSITIONAL_OR_KEYWORD
k=large v=large: bool kind=POSITIONAL_OR_KEYWORD
k=robot v=robot: Optional[str] kind=POSITIONAL_OR_KEYWORD
k=team v=team: Optional[int] kind=POSITIONAL_OR_KEYWORD
k=no_resolve v=no_resolve: bool kind=POSITIONAL_OR_KEYWORD
ERROR: C:\Users\kmott\OneDrive\Documents\GitHub\robot-2024-0\robot.py does not contain any robot classes

At least one class must inherit from wpilib.RobotBase or its descendents
I will try force reinstalling shortly, thank you!

Ok, I attempted the reinstall and it seemed to work at first then encountered some errors.
$ python -m pip install --force-reinstall -U robotpy
Collecting robotpy
Using cached robotpy-2024.2.1.1-py3-none-any.whl.metadata (7.5 kB)
Collecting robotpy-wpiutil==2024.2.1.2 (from robotpy)
Using cached robotpy_wpiutil-2024.2.1.2-cp312-cp312-win_amd64.whl.metadata (294 bytes)
Collecting robotpy-wpinet==2024.2.1.2 (from robotpy)
Using cached robotpy_wpinet-2024.2.1.2-cp312-cp312-win_amd64.whl.metadata (709 bytes)
Collecting robotpy-wpimath==2024.2.1.2 (from robotpy)
Using cached robotpy_wpimath-2024.2.1.2-cp312-cp312-win_amd64.whl.metadata (716 bytes)
Collecting pyntcore==2024.2.1.2 (from robotpy)
Using cached pyntcore-2024.2.1.2-cp312-cp312-win_amd64.whl.metadata (493 bytes)
Collecting robotpy-hal==2024.2.1.2 (from robotpy)
Using cached robotpy_hal-2024.2.1.2-cp312-cp312-win_amd64.whl.metadata (520 bytes)
Collecting wpilib==2024.2.1.2 (from robotpy)
Using cached wpilib-2024.2.1.2-cp312-cp312-win_amd64.whl.metadata (866 bytes)
Collecting robotpy-wpilib-utilities<2025,>=2024.0.0 (from robotpy)
Using cached robotpy_wpilib_utilities-2024.0.0-py3-none-any.whl.metadata (2.1 kB)
Collecting robotpy-cli<2025,>=2024.0.0 (from robotpy)
Using cached robotpy_cli-2024.0.0-py3-none-any.whl.metadata (4.1 kB)
Collecting robotpy-halsim-gui==2024.2.1.2 (from robotpy)
Using cached robotpy_halsim_gui-2024.2.1.2-cp312-cp312-win_amd64.whl.metadata (985 bytes)
Collecting robotpy-installer<2025,>=2024.1.3 (from robotpy)
Using cached robotpy_installer-2024.2.0-py3-none-any.whl.metadata (1.4 kB)
Collecting pyfrc<2025,>=2024.0.0 (from robotpy)
Using cached pyfrc-2024.0.1-py3-none-any.whl.metadata (2.2 kB)
Collecting pytest>=3.9 (from pyfrc<2025,>=2024.0.0->robotpy)
Using cached pytest-8.0.0-py3-none-any.whl.metadata (7.8 kB)
Collecting pytest-reraise (from pyfrc<2025,>=2024.0.0->robotpy)
Using cached pytest_reraise-2.1.2-py3-none-any.whl (5.2 kB)
Collecting pint>=0.11.0 (from pyfrc<2025,>=2024.0.0->robotpy)
Using cached Pint-0.23-py3-none-any.whl.metadata (8.1 kB)
Collecting packaging~=23.2 (from robotpy-installer<2025,>=2024.1.3->robotpy)
Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Collecting paramiko (from robotpy-installer<2025,>=2024.1.3->robotpy)
Using cached paramiko-3.4.0-py3-none-any.whl.metadata (4.4 kB)
Collecting pynetconsole~=2.0.2 (from robotpy-installer<2025,>=2024.1.3->robotpy)
Using cached pynetconsole-2.0.4-py3-none-any.whl (5.9 kB)
Collecting tomli (from robotpy-installer<2025,>=2024.1.3->robotpy)
Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting typing-extensions (from pint>=0.11.0->pyfrc<2025,>=2024.0.0->robotpy)
Using cached typing_extensions-4.9.0-py3-none-any.whl.metadata (3.0 kB)
Collecting iniconfig (from pytest>=3.9->pyfrc<2025,>=2024.0.0->robotpy)
Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting pluggy<2.0,>=1.3.0 (from pytest>=3.9->pyfrc<2025,>=2024.0.0->robotpy)
Using cached pluggy-1.4.0-py3-none-any.whl.metadata (4.3 kB)
Collecting colorama (from pytest>=3.9->pyfrc<2025,>=2024.0.0->robotpy)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting bcrypt>=3.2 (from paramiko->robotpy-installer<2025,>=2024.1.3->robotpy)
Using cached bcrypt-4.1.2-cp39-abi3-win_amd64.whl.metadata (9.8 kB)
Collecting cryptography>=3.3 (from paramiko->robotpy-installer<2025,>=2024.1.3->robotpy)
Using cached cryptography-42.0.2-cp39-abi3-win_amd64.whl.metadata (5.4 kB)
Collecting pynacl>=1.5 (from paramiko->robotpy-installer<2025,>=2024.1.3->robotpy)
Using cached PyNaCl-1.5.0-cp36-abi3-win_amd64.whl (212 kB)
Collecting cffi>=1.12 (from cryptography>=3.3->paramiko->robotpy-installer<2025,>=2024.1.3->robotpy)
Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl.metadata (1.5 kB)
Collecting pycparser (from cffi>=1.12->cryptography>=3.3->paramiko->robotpy-installer<2025,>=2024.1.3->robotpy)
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Using cached robotpy-2024.2.1.1-py3-none-any.whl (2.5 kB)
Using cached pyntcore-2024.2.1.2-cp312-cp312-win_amd64.whl (1.6 MB)
Using cached robotpy_hal-2024.2.1.2-cp312-cp312-win_amd64.whl (966 kB)
Using cached robotpy_halsim_gui-2024.2.1.2-cp312-cp312-win_amd64.whl (9.6 MB)
Using cached robotpy_wpimath-2024.2.1.2-cp312-cp312-win_amd64.whl (4.4 MB)
Using cached robotpy_wpinet-2024.2.1.2-cp312-cp312-win_amd64.whl (952 kB)
Using cached robotpy_wpiutil-2024.2.1.2-cp312-cp312-win_amd64.whl (3.7 MB)
Using cached wpilib-2024.2.1.2-cp312-cp312-win_amd64.whl (3.6 MB)
Using cached pyfrc-2024.0.1-py3-none-any.whl (35 kB)
Using cached robotpy_cli-2024.0.0-py3-none-any.whl (8.9 kB)
Using cached robotpy_installer-2024.2.0-py3-none-any.whl (38 kB)
Using cached robotpy_wpilib_utilities-2024.0.0-py3-none-any.whl (47 kB)
Using cached packaging-23.2-py3-none-any.whl (53 kB)
Using cached Pint-0.23-py3-none-any.whl (305 kB)
Using cached pytest-8.0.0-py3-none-any.whl (334 kB)
Using cached paramiko-3.4.0-py3-none-any.whl (225 kB)
Using cached bcrypt-4.1.2-cp39-abi3-win_amd64.whl (158 kB)
Using cached cryptography-42.0.2-cp39-abi3-win_amd64.whl (2.9 MB)
Using cached pluggy-1.4.0-py3-none-any.whl (20 kB)
Using cached typing_extensions-4.9.0-py3-none-any.whl (32 kB)
Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl (181 kB)
Installing collected packages: typing-extensions, tomli, robotpy-wpiutil, robotpy-cli, pynetconsole, pycparser, pluggy, packaging, iniconfig, colorama, bcrypt, robotpy-wpinet, robotpy-wpimath, robotpy-hal, pytest, pint, cffi, pytest-reraise, pyntcore, pynacl, cryptography, wpilib, robotpy-halsim-gui, paramiko, robotpy-wpilib-utilities, robotpy-installer, pyfrc, robotpy
Attempting uninstall: typing-extensions
Found existing installation: typing_extensions 4.9.0
Uninstalling typing_extensions-4.9.0:
Successfully uninstalled typing_extensions-4.9.0
Attempting uninstall: tomli
Found existing installation: tomli 2.0.1
Uninstalling tomli-2.0.1:
Successfully uninstalled tomli-2.0.1
Attempting uninstall: robotpy-wpiutil
Found existing installation: robotpy-wpiutil 2024.2.1.2
Uninstalling robotpy-wpiutil-2024.2.1.2:
Successfully uninstalled robotpy-wpiutil-2024.2.1.2
Attempting uninstall: robotpy-cli
Found existing installation: robotpy-cli 2024.0.0
Uninstalling robotpy-cli-2024.0.0:
Successfully uninstalled robotpy-cli-2024.0.0
Attempting uninstall: pynetconsole
Found existing installation: pynetconsole 2.0.4
Uninstalling pynetconsole-2.0.4:
Successfully uninstalled pynetconsole-2.0.4
Attempting uninstall: pycparser
Found existing installation: pycparser 2.21
Uninstalling pycparser-2.21:
Successfully uninstalled pycparser-2.21
Attempting uninstall: pluggy
Found existing installation: pluggy 1.4.0
Uninstalling pluggy-1.4.0:
Successfully uninstalled pluggy-1.4.0
Attempting uninstall: packaging
Found existing installation: packaging 23.2
Uninstalling packaging-23.2:
Successfully uninstalled packaging-23.2
Attempting uninstall: iniconfig
Found existing installation: iniconfig 2.0.0
Uninstalling iniconfig-2.0.0:
Successfully uninstalled iniconfig-2.0.0
Attempting uninstall: colorama
Found existing installation: colorama 0.4.6
Uninstalling colorama-0.4.6:
Successfully uninstalled colorama-0.4.6
Attempting uninstall: bcrypt
Found existing installation: bcrypt 4.1.2
Uninstalling bcrypt-4.1.2:
Successfully uninstalled bcrypt-4.1.2
Attempting uninstall: robotpy-wpinet
Found existing installation: robotpy-wpinet 2024.2.1.2
Uninstalling robotpy-wpinet-2024.2.1.2:
Successfully uninstalled robotpy-wpinet-2024.2.1.2
Attempting uninstall: robotpy-wpimath
Found existing installation: robotpy-wpimath 2024.2.1.2
Uninstalling robotpy-wpimath-2024.2.1.2:
Successfully uninstalled robotpy-wpimath-2024.2.1.2
Attempting uninstall: robotpy-hal
Found existing installation: robotpy-hal 2024.2.1.2
Uninstalling robotpy-hal-2024.2.1.2:
Successfully uninstalled robotpy-hal-2024.2.1.2
Attempting uninstall: pytest
Found existing installation: pytest 8.0.0
Uninstalling pytest-8.0.0:
Successfully uninstalled pytest-8.0.0
Attempting uninstall: pint
Found existing installation: Pint 0.23
Uninstalling Pint-0.23:
Successfully uninstalled Pint-0.23
Attempting uninstall: cffi
Found existing installation: cffi 1.16.0
Uninstalling cffi-1.16.0:
Successfully uninstalled cffi-1.16.0
Attempting uninstall: pytest-reraise
Found existing installation: pytest-reraise 2.1.2
Uninstalling pytest-reraise-2.1.2:
Successfully uninstalled pytest-reraise-2.1.2
Attempting uninstall: pyntcore
Found existing installation: pyntcore 2024.2.1.2
Uninstalling pyntcore-2024.2.1.2:
Successfully uninstalled pyntcore-2024.2.1.2
Attempting uninstall: pynacl
Found existing installation: PyNaCl 1.5.0
Uninstalling PyNaCl-1.5.0:
Successfully uninstalled PyNaCl-1.5.0
Attempting uninstall: cryptography
Found existing installation: cryptography 42.0.2
Uninstalling cryptography-42.0.2:
Successfully uninstalled cryptography-42.0.2
Attempting uninstall: wpilib
Found existing installation: wpilib 2024.2.1.2
Uninstalling wpilib-2024.2.1.2:
Successfully uninstalled wpilib-2024.2.1.2
Attempting uninstall: robotpy-halsim-gui
Found existing installation: robotpy-halsim-gui 2024.2.1.2
Uninstalling robotpy-halsim-gui-2024.2.1.2:
Successfully uninstalled robotpy-halsim-gui-2024.2.1.2
Attempting uninstall: paramiko
Found existing installation: paramiko 3.4.0
Uninstalling paramiko-3.4.0:
Successfully uninstalled paramiko-3.4.0
Attempting uninstall: robotpy-wpilib-utilities
Found existing installation: robotpy-wpilib-utilities 2024.0.0
Uninstalling robotpy-wpilib-utilities-2024.0.0:
Successfully uninstalled robotpy-wpilib-utilities-2024.0.0
Attempting uninstall: robotpy-installer
Found existing installation: robotpy-installer 2024.2.0
Uninstalling robotpy-installer-2024.2.0:
Successfully uninstalled robotpy-installer-2024.2.0
Attempting uninstall: pyfrc
Found existing installation: pyfrc 2024.0.1
Uninstalling pyfrc-2024.0.1:
Successfully uninstalled pyfrc-2024.0.1
Attempting uninstall: robotpy
Found existing installation: robotpy 2024.2.1.1
Uninstalling robotpy-2024.2.1.1:
Successfully uninstalled robotpy-2024.2.1.1
ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
robotpy-apriltag 2024.1.1.1 requires robotpy-wpimath==2024.1.1.1, but you have robotpy-wpimath 2024.2.1.2 which is incompatible.
robotpy-apriltag 2024.1.1.1 requires robotpy-wpiutil==2024.1.1.1, but you have robotpy-wpiutil 2024.2.1.2 which is incompatible.
robotpy-cscore 2024.1.1.1 requires pyntcore==2024.1.1.1, but you have pyntcore 2024.2.1.2 which is incompatible.
robotpy-cscore 2024.1.1.1 requires robotpy-wpinet==2024.1.1.1, but you have robotpy-wpinet 2024.2.1.2 which is incompatible.
robotpy-cscore 2024.1.1.1 requires robotpy-wpiutil==2024.1.1.1, but you have robotpy-wpiutil 2024.2.1.2 which is incompatible.
robotpy-halsim-ds-socket 2024.1.1.1 requires robotpy-hal==2024.1.1.1, but you have robotpy-hal 2024.2.1.2 which is incompatible.
robotpy-halsim-ds-socket 2024.1.1.1 requires robotpy-wpinet==2024.1.1.1, but you have robotpy-wpinet 2024.2.1.2 which is incompatible.
robotpy-halsim-ws 2024.1.1.1 requires robotpy-hal==2024.1.1.1, but you have robotpy-hal 2024.2.1.2 which is incompatible.
robotpy-halsim-ws 2024.1.1.1 requires robotpy-wpinet==2024.1.1.1, but you have robotpy-wpinet 2024.2.1.2 which is incompatible.
robotpy-romi 2024.1.1.1 requires wpilib==2024.1.1.1, but you have wpilib 2024.2.1.2 which is incompatible.
robotpy-xrp 2024.1.1.1 requires wpilib==2024.1.1.1, but you have wpilib 2024.2.1.2 which is incompatible.
Successfully installed bcrypt-4.1.2 cffi-1.16.0 colorama-0.4.6 cryptography-42.0.2 iniconfig-2.0.0 packaging-23.2 paramiko-3.4.0 pint-0.23 pluggy-1.4.0 pycparser-2.21 pyfrc-2024.0.1 pynacl-1.5.0 pynetconsole-2.0.4 pyntcore-2024.2.1.2 pytest-8.0.0 pytest-reraise-2.1.2 robotpy-2024.2.1.1 robotpy-cli-2024.0.0 robotpy-hal-2024.2.1.2 robotpy-halsim-gui-2024.2.1.2 robotpy-installer-2024.2.0 robotpy-wpilib-utilities-2024.0.0 robotpy-wpimath-2024.2.1.2 robotpy-wpinet-2024.2.1.2 robotpy-wpiutil-2024.2.1.2 tomli-2.0.1 typing-extensions-4.9.0 wpilib-2024.2.1.2

The errors are just because those packages need updates. The bigger question is whether deploy works now?

Update, we figured it out! We tried a separate, empty file, and put basic code in it to see if it was just the file itself. Somewhere along the line, our original project file got corrupted apparently, or something. We thankfully had the code on a separate computer, committed it to git, and recloned it. Thank you so much for your help!

… that’s really strange. Do you have the original file that caused the issue? Can you zip it up and send it to me, I’d love to look into this more.

robot-2024-0.zip (106.4 KB)
Sorry for getting back so late, we had to leave early last night. Here is the non-working file.

I suspect you’re referencing an old version of Phoenix5

See the “Python” tab for CTRE at 3rd Party Libraries — FIRST Robotics Competition documentation