TypeError: __init__() got an unexpected keyword argument 'mp_context'

Hi,
I am receiving the following error while trying to build nbdev lib. It occurs while running tests after git commit.
Please note that there is a similar thread about an issue with one of the lessons in the course, which was also shared today.

Traceback (most recent call last):
File “/opt/hostedtoolcache/Python/3.6.12/x64/bin/nbdev_test_nbs”, line 8, in
sys.exit(nbdev_test_nbs())
File “/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/fastscript/core.py”, line 76, in _f
func(**args.dict)
File “/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/nbdev/cli.py”, line 66, in nbdev_test_nbs
results = parallel(_test_one, files, flags=flags, verbose=verbose, n_workers=n_workers, pause=pause)
File “/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/fastcore/utils.py”, line 706, in parallel
with ProcessPoolExecutor(n_workers, pause=pause) as ex:
File “/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/fastcore/utils.py”, line 687, in init
super().init(max_workers, mp_context=mp_context, initializer=initializer, initargs=initargs)
TypeError: init() got an unexpected keyword argument ‘mp_context’
##[error]Process completed with exit code 1.

1 Like

Many apologies - that should be fixed now in the latest fastcore

3 Likes

Thanks for the kind response, Jeremy. It is working now.

Try changing first line to this
!pip install fastcore==1.0.9

I am having this problem right now when the github workflow runs:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.6.12/x64/bin/nbdev_test_nbs", line 8, in <module>
    sys.exit(nbdev_test_nbs())
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/fastscript/core.py", line 76, in _f
    func(**args.__dict__)
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/nbdev/cli.py", line 66, in nbdev_test_nbs
    results = parallel(_test_one, files, flags=flags, verbose=verbose, n_workers=n_workers, pause=pause)
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/fastcore/utils.py", line 712, in parallel
    with ProcessPoolExecutor(n_workers, pause=pause) as ex:
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/fastcore/utils.py", line 693, in __init__
    super().__init__(max_workers, mp_context=mp_context, initializer=initializer, initargs=initargs)
TypeError: __init__() got an unexpected keyword argument 'mp_context'
##[error]Process completed with exit code 1.

But locally, the tests run fine.

On github, I can see that the installed version is 1.0.13:

Collecting fastcore>=1.0.5
  Downloading fastcore-1.0.13-py3-none-any.whl (40 kB)

whereas my local version is 1.0.9

1 Like

And updating .github/workflow/main.yaml to:

    # ...other stuff

    - name: Install the library
      run: |
        pip install fastcore==1.0.9
        pip install nbdev jupyter
        pip install -e .

    # ...more stuff

Makes the github build run.

It is still throwing the same error.

I get this error too. There is an intermittent issue that keeps popping up on Mac OSX. Therefore, I do all my development in a Docker Container.

This is now made easy in each repo, you can just do docker-compose up to bring up a full development environment.

[TypeError: init() got an unexpected keyword argument ‘layer’]

Can you file a bug on GitHub about this?

1 Like

Your issue here is the param is layers, not layer

1 Like

Thanks, But…

TypeError: init() got an unexpected keyword argument ‘ps’

You should use doc(tabular_learner) to see what all you can pass in. ps is no longer a param (I forget what the equivalent is OOTOMH)

1 Like

I tried but I think I should go back to feature engineer my dataframe
Thanks