1

I am trying to install python package Nlopt, which is a requirement for Semi-Supervised learning package semisup-learn. But getting this error in the command line. I checked other installing issues with Nlopt, but I didn't find the solution for this. In its Github nobody has raised this issue, so it looks like something is wrong with my computer side. Could anybody tell me what this error means and how to fix?

My python version: 3.6.8

MakotonoMacBook-ea:site-packages makotomiyazaki$ pip install nlopt

Collecting nlopt
Using cached https://files.pythonhosted.org/packages/7f/4f/de7e64a295e86c9f1ee382076019e0526247969353eb29345da1a05854b6/nlopt-2.4.2.post2.tar.gz
Requirement already satisfied: numpy in /Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages (from nlopt) (1.16.4)
Building wheels for collected packages: nlopt
Building wheel for nlopt (setup.py) ... error
ERROR: Complete output from command /Users/makotomiyazaki/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/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 /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-wheel-m3pr939i --python-tag cp36:
ERROR: running bdist_wheel
running build
running build_ext /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/configure --prefix=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6 --libdir=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6 --enable-shared --without-guile --without-octave --without-matlab
extdir: /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6
build_temp: build/temp.macosx-10.7-x86_64-3.6
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking whether to enable maintainer-specific portions of 
Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6':
configure: error: C compiler cannot create executables
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 124, in <module>
  'Programming Language :: Python :: 3'
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
  return distutils.core.setup(**attrs)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/core.py", line 148, in setup
  dist.run_commands()
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 955, in run_commands
  self.run_command(cmd)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
  cmd_obj.run()
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 179, in run
  self.run_command('build')
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
  self.distribution.run_command(command)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
  cmd_obj.run()
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/command/build.py", line 135, in run
  self.run_command(cmd_name)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
  self.distribution.run_command(command)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
  cmd_obj.run()
File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 37, in run
  self.build_extension(ext)
File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 66, in build_extension
  subprocess.check_call(config_cmd, cwd=self.build_temp, env=os.environ)
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/subprocess.py", line 311, in check_call
  raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/configure', '--prefix=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6', '--libdir=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6', '--enable-shared', '--without-guile', '--without-octave', '--without-matlab']' returned non-zero exit status 77.

ERROR: Failed building wheel for nlopt
Running setup.py clean for nlopt
Failed to build nlopt
Installing collected packages: nlopt
Running setup.py install for nlopt ... error
ERROR: Complete output from command 
/Users/makotomiyazaki/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-record-gzrc6abe/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_ext
/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/configure --prefix=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6 --libdir=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6 --enable-shared --without-guile --without-octave --without-matlab
extdir: /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6
build_temp: build/temp.macosx-10.7-x86_64-3.6
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6':
configure: error: C compiler cannot create executables
See `config.log' for more details
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 124, in <module>
    'Programming Language :: Python :: 3'
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
    return orig.install.run(self)
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/command/install.py", line 545, in run
    self.run_command('build')
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 37, in run
    self.build_extension(ext)
  File "/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py", line 66, in build_extension
    subprocess.check_call(config_cmd, cwd=self.build_temp, env=os.environ)
  File "/Users/makotomiyazaki/anaconda3/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/configure', '--prefix=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/temp.macosx-10.7-x86_64-3.6', '--libdir=/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/build/lib.macosx-10.7-x86_64-3.6', '--enable-shared', '--without-guile', '--without-octave', '--without-matlab']' returned non-zero exit status 77.
----------------------------------------
ERROR: Command "/Users/makotomiyazaki/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-record-gzrc6abe/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/
Makoto Miyazaki
  • 1,743
  • 2
  • 23
  • 39
  • Can you show the `config.log` contents? – hoefling Jul 11 '19 at 12:43
  • could you tell me how to find that file? I'm referring to this https://stackoverflow.com/questions/8721779/what-is-config-log-on-osx-and-where-does-it-live but cannot find config.log in my current directory. – Makoto Miyazaki Jul 11 '19 at 13:03
  • it says that "config.log is stored in the current directory, at the time configure was called" but I cannot find it in my current directory – Makoto Miyazaki Jul 11 '19 at 13:41
  • Run `pip install nlopt --no-clean`, this won't delete the build dir. – hoefling Jul 11 '19 at 16:05
  • You will be able to read the path to build dir from the log, for example in the log you posted it's `/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-install-w15vucep/nlopt/` – hoefling Jul 11 '19 at 16:07

0 Answers0