Slugify error on Development environment

Hi all.
Ive got a dev envionrnt up and running and i can connect to HA.

When trying to use the scaffold script to create a new integration, i get the below error

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/home-assistant/script/scaffold/__main__.py", line 98, in <module>
    sys.exit(main())
  File "/usr/home-assistant/script/scaffold/__main__.py", line 49, in main
    info = gather_info.gather_info(args)
  File "/usr/home-assistant/script/scaffold/gather_info.py", line 22, in gather_info
    info = _gather_info(
  File "/usr/home-assistant/script/
scaffold/gather_info.py", line 153, in _gather_info
    if not validator(value):
  File "/usr/home-assistant/script/scaffold/gather_info.py", line 30, in <lambda>
    lambda value: value == slugify(value),
  File "/usr/home-assistant/homeassistant/util/__init__.py", line 49, in slugify
    return unicode_slug.slugify(text, separator="_")  # type: ignore
TypeError: slugify() got an unexpected keyword argument 'separator'

What have i missed ?

Note: I get the same error with python3.7 – i tried both to see if that was the issue.

FWIW, looks like that piece of code was last modified quite a while ago:

So nothing new there.

I took a look at the source of unicode_slug.slugify (which is actually from the python-slugify package), and it does have separator as a keyword parameter.

It looks like maybe your installation is pulling in the wrong package for slugify. Are you sure you installed your dev environment correctly, and activated the venv?

I believe so. Its definiitely in the venv.
Ive tried both python-slugify and the pip package too!

Maybe i have the wrong version or something, I will investigate further. Atleast that narrows the haystack a little.

I’m not sure I understand. If you install and activate correctly, you shouldn’t have to install python-slugify. That should be done automatically when you run script/setup.

Oh, well that’s interesting.

I had to install a number of python packages for setup to complete. Obviously something has gone wrong somewhere. Maybe I’ll just blow it away and start again.

I’m not sure what most developers do, but I’ve gotten into this habit when updating my checkout:

git clean -fdx -e venv
rm -rf .tox
script/setup

Sometimes script/setup results in errors, which sometimes I try to fix manually (by deleting whatever package(s) seem(s) to be causing the problem and re-running script/setup) or by simply deleting the venv dir and recreating it.