docs icon indicating copy to clipboard operation
docs copied to clipboard

TypeError: echo() got an unexpected keyword argument 'fg'

Open sadohert opened this issue 2 years ago • 4 comments

I'm getting back to building the docs to implement some edits on other Issues. It has been a very long time :) (I think I updated from June 2020).

Some environment background:

  1. I run MacOS Monterey 12.3.1
  2. Mostly install tools with brew. They are all up-to-date.
  3. I run zsh, so maybe pipenv is looking for something that's not available? I tried run in bash but same issue.

Running into this error/trace when I try to run pipenv install (following these directions). Any suggestions?

$ pipenv install
Installing dependencies from Pipfile.lock (eb74cc)...
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/cli/options.py", line 56, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/cli/command.py", line 222, in install
    do_install(
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/core.py", line 2092, in do_install
    do_init(
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/core.py", line 1336, in do_init
    do_install_dependencies(
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/core.py", line 871, in do_install_dependencies
    batch_install(
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/core.py", line 729, in batch_install
    deps_to_install = [
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/core.py", line 730, in <listcomp>
    dep for dep in deps_to_install if not project.environment.is_satisfied(dep)
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/project.py", line 319, in environment
    self._environment = self.get_environment(allow_global=allow_global)
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/project.py", line 299, in get_environment
    environment = Environment(
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/environment.py", line 70, in __init__
    self._base_paths = self.get_paths()
  File "/usr/local/Cellar/pipenv/2022.5.2/libexec/lib/python3.10/site-packages/pipenv/environment.py", line 413, in get_paths
    click.echo(f"Failed to load paths: {c.stderr}", fg="yellow")
TypeError: echo() got an unexpected keyword argument 'fg'

sadohert avatar May 09 '22 19:05 sadohert

Thanks, @sadohert. The docs team is also using Macs, and we mostly install tools via brew, including brew install python.

Setting up a docs environment typically requires me to run the following commands in order:

  1. brew install python
  2. pipenv -rm
  3. pipenv install

Perhaps give this a try? It sounds like the docs README may be a bit out of date.

cwarnermm avatar May 09 '22 19:05 cwarnermm

I did some searching around to figure out what the problem was. I don't have concrete links, but I think something in the click library that is used by pipenv is counting on a deprecated parameter for setting the foreground colour fg.

To work around this I setup a virtualenv environment, which used python3.9, and with this activated I was able install pipenv within the environment, and get past the pipenv install command.... we should maybe add this as a troubleshooting bullet on the README

sadohert avatar May 10 '22 14:05 sadohert

@sadohert - Does this continue to be an issue you're facing when building the documentation? Or can we close this issue?

cwarnermm avatar Jun 08 '22 21:06 cwarnermm

I'm not affected now that I use a virtualenv to control versions....might be worth a quick mention/note on the readme

sadohert avatar Jun 09 '22 15:06 sadohert