Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError on 'grp' module for 'openfisca serve' on Windows #1318

Open
sandcha opened this issue Dec 5, 2024 · 0 comments
Open

ImportError on 'grp' module for 'openfisca serve' on Windows #1318

sandcha opened this issue Dec 5, 2024 · 0 comments

Comments

@sandcha
Copy link
Collaborator

sandcha commented Dec 5, 2024

Hi there!

I really enjoy OpenFisca, but I recently encountered an issue.

Here is what I did:

On a workshop with members of the administration of a country that doesn't use openfisca (yet), we tried to install a country-template and to run its web API for the first time on 2 different computers with: openfisca serve --port 5000 --country-package openfisca_x

The operating system was Windows.
Both users have administrator rights on their laptops.
Python 3.11 was installed with Miniconda3.
The command line was used on Anaconda Prompt after a successful installation of the source code and a successful openfisca test.

Here is what I expected to happen:

To see the web API workers coming to life.

Here is what actually happened:

(.venv) C:\Users\name\Documents\openfisca-x >openfisca serve --port 5000 --country-package openfisca_x
Traceback (most recent call last):
  File "C:\Users\name\miniconda3\Lib\site-packages\openfisca_web_api\scripts\serve.py", line 9, in <module>
    from gunicorn import config
  File "C:\Users\name\miniconda3\Lib\site-packages\gunicorn\config.py", line 10, in <module>
    import grp
ModuleNotFoundError: No module named 'grp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\name\miniconda3\Scripts\openfisca.exe\__main__.py", line 7, in <module>
  File "C:\Users\name\miniconda3\Lib\site-packages\openfisca_core\scripts\openfisca_command.py", line 157, in main
    from openfisca_web_api.scripts.serve import main
  File "C:\Users\name\miniconda3\Lib\site-packages\openfisca_web_api\scripts\serve.py", line 12, in <module>
    handle_import_error(error)
  File "C:\Users\name\miniconda3\Lib\site-packages\openfisca_web_api\errors.py", line 10, in handle_import_error
    raise ImportError(
ImportError: OpenFisca is missing some dependencies to run the Web API: 'No module named 'grp''. To install them, run `pip install openfisca_core[web-api]`.

Running pip install openfisca_core[web-api] after that seemed to work well but, trying the same openfisca serve ended with the same grp error.

Here is data (or links to it) that can help you reproduce this issue:

We initialized the country package on July 18th 2024 (I'm telling the date because it looks like a country template v7.1.4 but we have 2 tags for this revision on different dates 🙀).

Its pyproject.toml contains the following openfisca-core dependency:

requires-python = ">=3.9"
dependencies = [
    "openfisca-core[web-api] >=41.4.5, <42.0.0"
]

And we installed it with:

pip install --upgrade pip build twine
pip install --editable .[dev] --upgrade

Context

Fo this issue, I identify more as a:

  • Business expert (I create tests and model legislation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant