Robotpy init not working

I’m trying to setup our robotpy project. When I run it I get a banner and no errors but the directory remains empty. What am I doing wrong?

Kyles-MBP-2:src kyle$ python3 -m robotpy init

                                                  /PPPPPPPPPPYYYYYYYYYY\       
                                                 /PPPPPPPPPPPYYYYYYYYYYY\      
                                                /PPPPPPPPPPPPYYYYYYYYYYYY\     
RRRRRR   OOOOOO  BBBBBB   OOOOOO  TTTTTTTT     /PPP       PPPY  YYYYYY  YY\    
RR   RR OO    OO BB   BB OO    OO    TT       /PPPP  PPPP   PY  YYYYYY  YYY\   
RR   RR OO    OO BB   BB OO    OO    TT      /PPPPP  PPPPP  PYY  YYYY  YYYYY\  
RR   RR OO    OO BB   BB OO    OO    TT     /PPPPPP  PPPPP  PYY  YYYY  YYYYYY\ 
RR   R  OO    OO BB   B  OO    OO    TT    /PPPPPPP  PPPP   PYYY  YY  YYYYYYYY\
RRRRRR  OO    OO BBBBBB  OO    OO    TT    \PPPPPPP       PPPYYYY    YYYYYYYYY/
RR   RR OO    OO BB   BB OO    OO    TT     \PPPPPP  PPPPPPPPYYYYY  YYYYYYYYY/ 
RR   RR OO    OO BB   BB OO    OO    TT      \PPPPP  PPPPPPPPYYYYY  YYYYYYYY/  
RR   RR OO    OO BB   BB OO    OO    TT       \PPPP  PPPPPPPPYYYYY  YYYYYYY/   
RR   RR  OOOOOO  BBBBBB   OOOOOO     TT        \PPP  PPPPPPPPYYYYY  YYYYYY/    
                                                \PPPPPPPPPPPPYYYYYYYYYYYY/     
                                                 \PPPPPPPPPPPYYYYYYYYYYY/      
                                                  \PPPPPPPPPPYYYYYYYYYY/ 

This keeps coming up, I need to update the docs, sorry. There’s some weird bug with pip. Do python3 -m pip uninstall robotpy followed by python3 -m pip install robotpy and the logo will go away.

Edit: Ok, I documented it now

Well I tried that and noticed it was removing a 2023 version and then I realized I didn’t have my virtualenv activated. So I did it again with it active. I get and error this time.

(venv) Kyles-MBP-2:frc-2024 kyle$ python3 -m robotpy init
Traceback (most recent call last):
  File "/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/robotpy/main.py", line 245, in main
    cmd_class = entry_point.load()
                ^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/pyfrc/mains/cli_sim.py", line 9, in <module>
    import wpilib
  File "/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/wpilib/__init__.py", line 1, in <module>
    from . import _init_wpilib
  File "/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/wpilib/_init_wpilib.py", line 10, in <module>
    import ntcore._init_ntcore
  File "/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/ntcore/__init__.py", line 1, in <module>
    from . import _init_ntcore
  File "/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/ntcore/_init_ntcore.py", line 9, in <module>
    import wpinet._init_wpinet
  File "/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/wpinet/__init__.py", line 1, in <module>
    from . import _init_wpinet
  File "/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/wpinet/_init_wpinet.py", line 12, in <module>
    _lib = cdll.LoadLibrary(join(_root, "lib", "libwpinet.dylib"))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 454, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: dlopen(/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/wpinet/lib/libwpinet.dylib, 0x0006): Symbol not found: (__ZN3fmt2v912format_errorD1Ev)
  Referenced from: '/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/wpinet/lib/libwpinet.dylib'
  Expected in: '/Users/kyle/src/frc-2024/venv/lib/python3.11/site-packages/wpiutil/lib/libwpiutil.dylib'
Plugin error detected in 'EntryPoint(name='sim', value='pyfrc.mains.cli_sim:PyFrcSim', group='robotpy')' (use --ignore-plugin-errors to ignore this)

I’ve definitely seen someone with that error… but it works on my mac at the moment, so we must have fixed it. What package versions do you have? I would ensure you’re on 2024.1.1.3.

Okay, I think I figured it out. Installing commands-v2 downgraded all the core robotpy packages. I blew away the venv and started over. After only installing robotpy the init worked. I then installed commands-v2 and noticed all the robotpy packages were downgraded to a 2023 version.

I saw something about commands not being ready yet but I thought I saw a follow-up about being able to use an older version.

You need to install robotpy-commands-v2==2024.0.0b4. The 2023 version will cause problems, as you can see.

Got it. I didn’t realize how pip handled beta versions. I assumed it always installed the newest. Appears we are good to go now.

Thank you for you prompt support!!