Open sdenier opened 4 years ago
OK digging quickly into the issue I see this is related to gunicorn which does not support Windows (not yet... this issue is opened since 2013 https://github.com/benoitc/gunicorn/issues/524)
Maybe we can close this issue unless there is an easy solution
You should be able to run OpenFisca with Waitress. cf. https://github.com/mes-aides/simulateur/issues/57 We faced the same issue.
Thanks for the tip!
I did a shameless/rudimentary copy of the serve script to use waitress and it worked: https://github.com/openfisca/openfisca-core/blob/master/openfisca_web_api/scripts/serve.py
for the record (not complete, just to get the idea)
from waitress import serve
DEFAULT_PORT = '5000'
HOST = '0.0.0.0'
def main(parser):
configuration = {}
configuration = read_user_configuration(configuration, parser)
tax_benefit_system = build_tax_benefit_system(
configuration.get('country_package'),
configuration.get('extensions'),
configuration.get('reforms')
)
app = create_app(
tax_benefit_system,
configuration.get('tracker_url'),
configuration.get('tracker_idsite'),
configuration.get('tracker_token'),
configuration.get('welcome_message')
)
serve(app, host=HOST, port=DEFAULT_PORT)
Note sure if someone is interested in a PR, there would be some refactoring to perform.
Also note that legislation-explorer needs some tricks to start in Windows environment:
.env
HOST=localhost
PORT=2020
# PATHNAME=/ # otherwise SSR would output some urls such as http://bootstrap/css/bootstrap.css ?
API_URL=http://localhost:5000
CHANGELOG_URL=https://github.com/openfisca/country-template/blob/master/CHANGELOG.md
UI_STRINGS={"en":{"countryName":"the development environment"},"fr":{"countryName":"l’environnement de développement"}}
# MATOMO_URL=https://stats.data.gouv.fr
# MATOMO_SITE_ID=4
package.json
{
"scripts":
"start": "set NODE_ENV=production&&node --require dotenv/config index.js",
}
Hi everyone!
We (@clallemand and I) have encountered the same problem recently (we try to launch openfisca serve
, which fails because of a missing fcntl
package ; we follow the recommandation to first run pip install openfisca-core[web-api]
, which does not solve the issue)
This problem is made a bit more acute when using openfisca-france, because testing the compatibility with the web api is now recommended as a validation step of any PR.
As a temporary fix we have resolved to asking third parties (such as @benjello or @HAEKADI , thanks to both of you!!) to test our branch for us.
Hi there
Summary: can we install and run
openfisca serve
on Windows? Right now I have the following error:NB - my use case: I am not an active developer on OF, but I would like to run the legislation-explorer on a branch of openfisca-france (not yet merged into master). So I'm just trying to run it locally.
Steps followed:
pip install openfisca-france
thenpip install openfisca-core[web-api]
- no problem so faropenfisca serve
- I got the following trace:I also tried to clone the repo and start from it, run with ConEmu, or look at this page https://openfisca.org/doc/installation/index.html but not luck.
I didn't go for the Docker solution yet.