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

pip install error #74

Closed
chaltik opened this issue Jun 5, 2019 · 9 comments
Closed

pip install error #74

chaltik opened this issue Jun 5, 2019 · 9 comments

Comments

@chaltik
Copy link

chaltik commented Jun 5, 2019

I get compilation error during pip install process on 18.04 when it build the ujson extension:

Running setup.py bdist_wheel for ujson ... error
Complete output from command /home/captain/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-74754z_z/ujson/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-puziaq_8 --python-tag cp36:
running bdist_wheel
running build
running build_ext
building 'ujson' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/python
creating build/temp.linux-x86_64-3.6/lib
gcc -pthread -B /home/captain/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/home/captain/anaconda3/include/python3.6m -c ./python/ujson.c -o build/temp.linux-x86_64-3.6/./python/ujson.o -D_GNU_SOURCE
In file included from /home/captain/anaconda3/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/include-fixed/syslimits.h:7:0,
from /home/captain/anaconda3/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/include-fixed/limits.h:34,
from /home/captain/anaconda3/include/python3.6m/Python.h:11,
from ./python/py_defines.h:39,
from ./python/ujson.c:39:
/home/captain/anaconda3/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
#include_next <limits.h> /* recurse down to the real one */

@lostella
Copy link
Contributor

lostella commented Jun 5, 2019

Looks like something may be missing in your system. Probably related: https://unix.stackexchange.com/questions/504139/installing-python-modules-fail-limits-h-missing

Can you try installing libgcc-N-dev where N is either 8 or 9, depending on what version of gcc you are using?

@sipemu
Copy link

sipemu commented Jun 7, 2019

I had the same error and installed the ujson package with the conda installer:

conda install ujson

@jaheba
Copy link
Contributor

jaheba commented Jun 11, 2019

When I tried to reproduce the error using a docker image, pip install gluonts failed, since no build system was installed -- unlike other dependencies, ujson needs to be built locally. After installing gcc, the installation went without any problems.

I also tried @sipemu's workaround by installing ujson directly via conda, which also worked.

@jaheba
Copy link
Contributor

jaheba commented Jun 13, 2019

Closing this now.

If you have any further questions, feel free to open this again.

@jaheba jaheba closed this as completed Jun 13, 2019
@michael135
Copy link

For me this helped:
sudo apt-get install python3.7-dev

I would suggest to add it to documntation or readme.
Installaion via pip install is far from being smooth.

@jaheba
Copy link
Contributor

jaheba commented Jun 17, 2019

I will open a ticket to add documentation for this.

Just for clarity: The issue is that some dependencies might need to be built locally, and thus installing gluonts requires a build system to be installed.

@to-morrow
Copy link

When I run 'pip install gluonts' I am continuously receiving the following error

'Building wheel for ujson (setup.py) ... error'

Following this attempts to run 'setup.py clean for ujson' which fails and then attempted "setup.py install for ujson" which also has an error.

I have read through a few of the threads and am not sure exactly where to post this question.

@jaheba
Copy link
Contributor

jaheba commented Oct 22, 2020

Hey @to-morrow, we depend on ujson and thus pip tries to install it when you want to install gluonts.

Once you can run pip install ujson, you should also be able to install gluonts.

@to-morrow
Copy link

I ended up removing everything and starting from scratch, I made sure to install ujson prior to gluonts however I am now receiving this error when trying to install gluonts.

ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-install-gnx14llm/matplotlib/setup.py'"'"'; file='"'"'/private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-install-gnx14llm/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-pip-egg-info-bynevv6t
cwd: /private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-install-gnx14llm/matplotlib/
Complete output (62 lines):

Edit setup.cfg to change the build options; suppress output with --quiet.

BUILDING MATPLOTLIB
  matplotlib: yes [3.3.2]
      python: yes [3.9.0 (v3.9.0:9cf6752276, Oct  5 2020, 11:29:23)  [Clang 6.0
                  (clang-600.0.57)]]
    platform: yes [darwin]
 sample_data: yes [installing]
       tests: no  [skipping due to configuration]
      macosx: yes [installing]

running egg_info
creating /private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-pip-egg-info-bynevv6t/matplotlib.egg-info
writing /private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-pip-egg-info-bynevv6t/matplotlib.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-pip-egg-info-bynevv6t/matplotlib.egg-info/dependency_links.txt
writing namespace_packages to /private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-pip-egg-info-bynevv6t/matplotlib.egg-info/namespace_packages.txt
writing requirements to /private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-pip-egg-info-bynevv6t/matplotlib.egg-info/requires.txt
writing top-level names to /private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-pip-egg-info-bynevv6t/matplotlib.egg-info/top_level.txt
writing manifest file '/private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-pip-egg-info-bynevv6t/matplotlib.egg-info/SOURCES.txt'
init_dgelsd failed init
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-install-gnx14llm/matplotlib/setup.py", line 242, in <module>
    setup(  # Finally, pass this all along to distutils to do the heavy lifting.
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
    return distutils.core.setup(**attrs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 297, in run
    self.find_sources()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 304, in find_sources
    mm.run()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 535, in run
    self.add_defaults()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 571, in add_defaults
    sdist.add_defaults(self)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/sdist.py", line 228, in add_defaults
    self._add_defaults_ext()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/sdist.py", line 311, in _add_defaults_ext
    build_ext = self.get_finalized_command('build_ext')
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 299, in get_finalized_command
    cmd_obj.ensure_finalized()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 107, in ensure_finalized
    self.finalize_options()
  File "/private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-install-gnx14llm/matplotlib/setup.py", line 88, in finalize_options
    self.distribution.ext_modules[:] = [
  File "/private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-install-gnx14llm/matplotlib/setup.py", line 91, in <listcomp>
    for ext in package.get_extensions()
  File "/private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-install-gnx14llm/matplotlib/setupext.py", line 345, in get_extensions
    add_numpy_flags(ext)
  File "/private/var/folders/48/rn61jbb544l_h28s7m5cgfn00000gn/T/pip-install-gnx14llm/matplotlib/setupext.py", line 469, in add_numpy_flags
    import numpy as np
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 286, in <module>
    raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned

----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

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

6 participants