italia/spid-django

The demo project doesn't work

alfio-faro opened this issue · 3 comments

After insert these commands:

  • cd example/
  • virtualenv -ppython3 env
  • source env/bin/activate
  • pip install -r ../requirements-dev.txt

Failed to build uwsgi
Installing collected packages: sqlparse, asgiref, pytz, django, pycparser, cffi, cryptography, six, pyOpenSSL, zipp, importlib-resources, defusedxml, idna, urllib3, certifi, chardet, requests, python-dateutil, elementpath, xmlschema, pysaml2, djangosaml2, pyflakes, autoflake, pycodestyle, toml, autopep8, coverage, pathspec, appdirs, click, regex, mypy-extensions, black, mccabe, flake8, isort, pbr, stevedore, smmap, gitdb, GitPython, PyYAML, bandit, py, filelock, pluggy, distlib, virtualenv, pyparsing, packaging, tox, lxml, simplejson, pytool, pyconfig, pyXMLSecurity, MarkupSafe, Jinja2, spid-sp-test, uwsgi
Running setup.py install for uwsgi ... error
ERROR: Command errored out with exit status 1:
command: /opt/spid-django/example/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3ps0ifje/uwsgi/setup.py'"'"'; file='"'"'/tmp/pip-install-3ps0ifje/uwsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-1dlptx6a/install-record.txt --single-version-externally-managed --compile --install-headers /opt/spid-django/example/env/include/site/python3.8/uwsgi
cwd: /tmp/pip-install-3ps0ifje/uwsgi/
Complete output (29 lines):
/usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'descriptions'
warnings.warn(msg)
running install
using profile: buildconf/default.ini
detected include path: ['/usr/include', '/usr/local/include']
Traceback (most recent call last):
File "/tmp/pip-install-3ps0ifje/uwsgi/uwsgiconfig.py", line 747, in init
gcc_version_components = gcc_version.split('.')
AttributeError: 'NoneType' object has no attribute 'split'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-3ps0ifje/uwsgi/setup.py", line 117, in <module>
    setup(
  File "/opt/spid-django/example/env/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/tmp/pip-install-3ps0ifje/uwsgi/setup.py", line 77, in run
    conf = uc.uConf(get_profile())
  File "/tmp/pip-install-3ps0ifje/uwsgi/uwsgiconfig.py", line 755, in __init__
    raise Exception("you need a C compiler to build uWSGI")
Exception: you need a C compiler to build uWSGI
----------------------------------------

ERROR: Command errored out with exit status 1: /opt/spid-django/example/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3ps0ifje/uwsgi/setup.py'"'"'; file='"'"'/tmp/pip-install-3ps0ifje/uwsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-1dlptx6a/install-record.txt --single-version-externally-managed --compile --install-headers /opt/spid-django/example/env/include/site/python3.8/uwsgi Check the logs for full command output.

Hi,
the demo on new release v0.8.0 is based on uwsgi, in order to run the demo with a full https server, but to install it you need a C compiler installed in your system, because some .c modules need to be built.

@alfio-faro
here a Dockerfile for facing problems of software distributions
https://github.com/italia/spid-django/blob/main/Dockerfile

@alfio-faro is this issue ready to be closed right now or you're still having troubles?