Cannot start dev environment, failing to run script/setup

I’ve cloned the core repository and have a local copy on my machine. I’ve run brew install python3 autoconf ffmpeg cmake make which all ran successfully.

Following the development guide I’m trying to run script/setup, but it’s failing with the following:

ERROR: Exception:
Traceback (most recent call last):
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_vendor/packaging/markers.py", line 278, in __init__
    self._markers = _coerce_parse_result(MARKER.parseString(marker))
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_vendor/pyparsing/util.py", line 256, in _inner
    return fn(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_vendor/pyparsing/core.py", line 1190, in parse_string
    raise exc.with_traceback(None)
pip._vendor.pyparsing.exceptions.ParseException: , found '31m'  (at char 0), (line:1, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 245, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 342, in run
    reqs = self.get_requirements(args, options, finder, session)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 411, in get_requirements
    req_to_add = install_req_from_line(
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_internal/req/constructors.py", line 421, in install_req_from_line
    parts = parse_req_from_line(name, line_source)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_internal/req/constructors.py", line 323, in parse_req_from_line
    markers = Marker(markers_as_string)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hummingbear/Code/core/venv/lib/python3.11/site-packages/pip/_vendor/packaging/markers.py", line 280, in __init__
    raise InvalidMarker(
pip._vendor.packaging.markers.InvalidMarker: Invalid marker: '31m\x1b[Kawesomeversion\x1b[m\x1b[K==23.11.0', parse error at '31m\x1b[Kaw'

When I pick apart script/setup it’s failing while trying to run python3 -m pip install colorlog pre-commit $(grep awesomeversion requirements.txt) --constraint homeassistant/package_constraints.txt --upgrade in script/bootstrap

I have tried searching on the relevant exceptions that are raised in the stacktrace. I’ve also tried nuking and re-installing python. I must admit I am not an expert in Python so I’m a little out of my element. What is going on here?

You’ll have better luck asking on the devs group in Discord.

1 Like