Bigchaindb: Problem on installation of package: distutils.errors.DistutilsError

Created on 12 Feb 2016  路  3Comments  路  Source: bigchaindb/bigchaindb

When trying python3.4 -m pip install bigchaindb this error display on Ubuntu Trusty 64:

 File "/usr/lib/python3.4/distutils/command/build_ext.py", line 448, in build_extensions
        self.build_extension(ext)
      File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 178, in build_exte
nsion
        _build_ext.build_extension(self,ext)
      File "/usr/lib/python3.4/distutils/command/build_ext.py", line 503, in build_extension
        depends=ext.depends)
      File "/usr/lib/python3.4/distutils/ccompiler.py", line 574, in compile
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/usr/lib/python3.4/distutils/unixccompiler.py", line 118, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1025, in run_se
tup
        run_setup(setup_script, args)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 50, in run_setup
        lambda: execfile(
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 100, in run
        return func()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 52, in <lambda>
        {'__file__':setup_script, '__name__':'__main__'}
      File "/usr/lib/python3/dist-packages/setuptools/compat.py", line 78, in execfile
        exec(compile(source, fn, 'exec'), globs, locs)
      File "setup.py", line 192, in <module>
        elif argv[i - 1:i] == ['--egg-base']:
      File "/usr/lib/python3.4/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip_build_root/cryptography/setup.py", line 318, in <module>
        **keywords_with_side_effects(sys.argv)
      File "/usr/lib/python3.4/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 239, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 264, in fetch_build_eggs
        replace_conflicting=True
      File "/usr/lib/python3/dist-packages/pkg_resources.py", line 620, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources.py", line 858, in best_match
        return self.obtain(req, installer) # try and download/install
      File "/usr/lib/python3/dist-packages/pkg_resources.py", line 870, in obtain
        return installer(requirement)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 314, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 616, in easy_in
stall
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 646, in install
_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 834, in install
_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1040, in build_
and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1028, in run_se
tup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc'
failed with exit status 1
    Complete output from command /usr/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/p
ip_build_root/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().r
eplace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-t7ka_7vj-record/install-record.t
xt --single-version-externally-managed --compile:
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory

 #include <ffi.h>

                 ^

compilation terminated.

Traceback (most recent call last):

  File "/usr/lib/python3.4/distutils/unixccompiler.py", line 116, in _compile

    extra_postargs)

  File "/usr/lib/python3.4/distutils/ccompiler.py", line 909, in spawn

    spawn(cmd, dry_run=self.dry_run)

  File "/usr/lib/python3.4/distutils/spawn.py", line 36, in spawn

    _spawn_posix(cmd, search_path, dry_run=dry_run)

  File "/usr/lib/python3.4/distutils/spawn.py", line 162, in _spawn_posix

    % (cmd, exit_status))

distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "/usr/lib/python3.4/distutils/core.py", line 148, in setup

    dist.run_commands()

  File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands

    self.run_command(cmd)

  File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command

    cmd_obj.run()

  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 185, in run

    cmd = self.call_command('install_lib', warn_dir=0)

  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 171, in call_command

    self.run_command(cmdname)

  File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command

    self.distribution.run_command(command)

  File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command

    cmd_obj.run()

  File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 21, in run

    self.build()

  File "/usr/lib/python3.4/distutils/command/install_lib.py", line 109, in build

    self.run_command('build_ext')

  File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command

    self.distribution.run_command(command)

  File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command

    cmd_obj.run()

  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 49, in run

    _build_ext.run(self)

  File "/usr/lib/python3.4/distutils/command/build_ext.py", line 339, in run

    self.build_extensions()

  File "/usr/lib/python3.4/distutils/command/build_ext.py", line 448, in build_extensions

    self.build_extension(ext)

  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 178, in build_extensio
n

    _build_ext.build_extension(self,ext)

  File "/usr/lib/python3.4/distutils/command/build_ext.py", line 503, in build_extension

    depends=ext.depends)

  File "/usr/lib/python3.4/distutils/ccompiler.py", line 574, in compile

    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)

  File "/usr/lib/python3.4/distutils/unixccompiler.py", line 118, in _compile

    raise CompileError(msg)

distutils.errors.CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1025, in run_setup

    run_setup(setup_script, args)

  File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 50, in run_setup

    lambda: execfile(

  File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 100, in run

    return func()

  File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 52, in <lambda>

    {'__file__':setup_script, '__name__':'__main__'}

  File "/usr/lib/python3/dist-packages/setuptools/compat.py", line 78, in execfile

    exec(compile(source, fn, 'exec'), globs, locs)

  File "setup.py", line 192, in <module>

    elif argv[i - 1:i] == ['--egg-base']:

  File "/usr/lib/python3.4/distutils/core.py", line 163, in setup

    raise SystemExit("error: " + str(msg))

SystemExit: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/tmp/pip_build_root/cryptography/setup.py", line 318, in <module>

    **keywords_with_side_effects(sys.argv)

  File "/usr/lib/python3.4/distutils/core.py", line 108, in setup

    _setup_distribution = dist = klass(attrs)

  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 239, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 264, in fetch_build_eggs

    replace_conflicting=True

  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 620, in resolve

    dist = best[req.key] = env.best_match(req, ws, installer)

  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 858, in best_match

    return self.obtain(req, installer) # try and download/install

  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 870, in obtain

    return installer(requirement)

  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 314, in fetch_build_egg

    return cmd.easy_install(req)

  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 616, in easy_instal
l

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 646, in install_ite
m

    dists = self.install_eggs(spec, download, tmpdir)

  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 834, in install_egg
s

    return self.build_and_install(setup_script, setup_base)

  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_
install

    self.run_setup(setup_script, setup_base, args)

  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1028, in run_setup

    raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' fail
ed with exit status 1

Command /usr/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/cryptograph
y/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record /tmp/pip-t7ka_7vj-record/install-record.txt --single-version-exter
nally-managed --compile failed with error code 1 in /tmp/pip_build_root/cryptography
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 707, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/lib/python3/dist-packages/pip/util.py", line 715, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command /usr/bin/python3.4 -c "import setuptools, tokenize;__file_
_='/tmp/pip_build_root/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__)
.read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-t7ka_7vj-record/install
-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build
_root/cryptography

Compiling works properly for other software and packages.
GCC version: Ubuntu 4.8.4-2ubuntu1~14.04.1

BUG

Most helpful comment

Heh, yes I ran into the same problem myself today. Most of the issues are due to OS-level dependencies required by the cryptography module. I found that the following resolved all those dependencies for me (on Ubuntu 14.04 trusty 64 bit):

$ sudo apt-get update
$ sudo apt-get install libffi-dev g++ libssl-dev

You can read more about cryptography dependencies at https://cryptography.io/en/latest/installation/

I've updated the installation instructions and those are now in PR #26

All 3 comments

Heh, yes I ran into the same problem myself today. Most of the issues are due to OS-level dependencies required by the cryptography module. I found that the following resolved all those dependencies for me (on Ubuntu 14.04 trusty 64 bit):

$ sudo apt-get update
$ sudo apt-get install libffi-dev g++ libssl-dev

You can read more about cryptography dependencies at https://cryptography.io/en/latest/installation/

I've updated the installation instructions and those are now in PR #26

:+1:

THKS a LOT!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaekwon picture jaekwon  路  6Comments

ppiyakk2 picture ppiyakk2  路  6Comments

ttmc picture ttmc  路  3Comments

xuhuigithub picture xuhuigithub  路  6Comments

darkodraskovic picture darkodraskovic  路  4Comments