Brainframe-cli failed: AttributeError: module 'packaging.version' has no attribute 'LegacyVersion'

Archived from the BrainFrame forum. Posted Mar 13, 2025. 0 replies · 172 views

AOTU support

If you see the following error when you run ‘brainframe compose up’,

Traceback (most recent call last):
File “/home/user/workspace/myenv/bin/brainframe”, line 5, in 
from brainframe.cli.main import main
File “/home/user/workspace/myenv/lib/python3.12/site-packages/brainframe/cli/main.py”, line 9, in 
from brainframe.cli import commands
File “/home/user/workspace/myenv/lib/python3.12/site-packages/brainframe/cli/commands/init.py”, line 5, in 
from .self_update import self_update
File “/home/user/workspace/myenv/lib/python3.12/site-packages/brainframe/cli/commands/self_update.py”, line 97, in 
) → Union[version.LegacyVersion, version.Version]:
^^^^^^^^^^^^^^^^^^^^^
AttributeError: module ‘packaging.version’ has no attribute ‘LegacyVersion’

The following will fix it,

pip install ‘packaging<=21.3’

This is because of the compatibility issue introduced by latest python packaging module. The version compatible with the current brainframe-cli tool is 21.3. This issue will be fixed by the next brainframe-cli release.