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

Could not build because of missing 'limits.h' #321

Closed
marcosoldati opened this issue May 10, 2019 · 6 comments
Closed

Could not build because of missing 'limits.h' #321

marcosoldati opened this issue May 10, 2019 · 6 comments
Labels
support Support questions (should be on discourse.jupyter.org instead)

Comments

@marcosoldati
Copy link

marcosoldati commented May 10, 2019

When running the installer I ran into this issue:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 455, in <module>
    main()
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 438, in main
    ensure_user_environment(args.user_requirements_txt_url)
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 257, in ensure_user_environment
    'tornado<6.0'
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/conda.py", line 133, in ensure_pip_packages
    ] + packages, stderr=subprocess.STDOUT)
  File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/opt/tljh/user/bin/python', '-m', 'pip', 'install', '--no-cache-dir', 'jupyterhub==0.9.6', 'notebook==5.7.8', 'jupyterlab==0.35.4', 'nteract-on-jupyter==2.0.7', 'nbgitpuller==0.6.1', 'nbresuse==0.3.0', 'ipywidgets==7.4.2', 'tornado<6.0']' returned non-zero exit status 1.

Trying to call the command manually unveiled this error:

...
    building 'psutil._psutil_linux' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/psutil
    gcc -pthread -B /opt/tljh/user/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=562 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/opt/tljh/user/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
    In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/syslimits.h:7:0,
                     from /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/limits.h:34,
                     from /opt/tljh/user/include/python3.6m/Python.h:11,
                     from psutil/_psutil_common.c:9:
    /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/limits.h:194:15: fatal error: limits.h: No such file or directory
     #include_next <limits.h>  /* recurse down to the real one */
                   ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/opt/tljh/user/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-c2x9uyw7/psutil/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-ojs_5yct/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-c2x9uyw7/psutil/    

Turned out the python3-dev packages were missing on my fresh Ubuntu installation. After a

sudo apt-get install python3-dev

everything went smooth.

If anyone else encounters this issue you may want to add this to the documentation / known_issues.

Solution found here: giampaolo/psutil#1143

@marcosoldati marcosoldati changed the title Could not build because of missing python3-dev Could not build because of missing python3-dev - update documentation / known issues May 10, 2019
@yuvipanda
Copy link
Collaborator

Thanks for opening this. Adding -dev to initial install seems sensible to me.

What version of Ubuntu was this on? Works ok on 18.04 still...

@yuvipanda
Copy link
Collaborator

On debugging this a little more, it looks like the error is in fatal error: limits.h: No such file or directory, which isn't python related. It looks like it's in the libgcc-x-dev packages, from looking at output of dpkg -S limits.h | grep linux. Installing gcc should install that...

Are you using a minimal ubuntu image by any chance? It looks like the installation still succeeds right now on Ubuntu 18.04

@yuvipanda yuvipanda changed the title Could not build because of missing python3-dev - update documentation / known issues Could not build because of missing 'limits.h' May 18, 2019
@yuvipanda yuvipanda added bug Something isn't working support Support questions (should be on discourse.jupyter.org instead) and removed bug Something isn't working labels May 20, 2019
@marcosoldati
Copy link
Author

marcosoldati commented Jun 4, 2019

Sorry for not getting back to you earlier.
I am using Ubuntu 18.04.2 LTS. I am using a preconfigured image from my cloud provider. Unfortunately I do not have any hint if they changed anything.

@cmseal
Copy link

cmseal commented Oct 29, 2019

I've had the same issue using a cloud base image of 18.04.2 LTS. Looking, gcc and libgcc-7-dev were already installed.

Installing python3-dev included dh-python libc-dev-bin libc6-dev libexpat1-dev libpython3-dev libpython3.6-dev linux-libc-dev python3.6-dev.

After installing those, re-running the original TLJH install line worked fine! (just a note about a newer version of conda being available)

HTH.

@consideRatio
Copy link
Member

I'll close this issue in favor of #730 that more directly tries to address the situation discussed in this issue. So to conclude - this may not be resolved, but resolving this is tracked via #730 now.

@RainnyNightLover
Copy link

meet this for use the Alibaba resource, change it back to ubuntu, fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Support questions (should be on discourse.jupyter.org instead)
Projects
None yet
Development

No branches or pull requests

5 participants