2 years ago

#28009

test-img

ChristianOConnor

can't build pip python package from source, I get unclear errors trying to building coincurve

I am trying to pip install a package by building it from source. This is the command I used pip install coincurve --no-binary :all:

I have a 2021 Macbook M1 Pro and I'm using pyenv with a virtualenv python version 3.10.1.

The terminal output was very unclear as to why the build failed:

(the_python_env) myusername@My-MacBook-Pro my_project % pip install coincurve --no-binary :all:
Collecting coincurve
  Using cached coincurve-16.0.0.tar.gz (219 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: asn1crypto in /Users/myusername/.virtualenvs/the_python_env/lib/python3.10/site-packages (from coincurve) (1.4.0)
Requirement already satisfied: cffi>=1.3.0 in /Users/myusername/.virtualenvs/the_python_env/lib/python3.10/site-packages (from coincurve) (1.15.0)
Requirement already satisfied: pycparser in /Users/myusername/.virtualenvs/the_python_env/lib/python3.10/site-packages (from cffi>=1.3.0->coincurve) (2.21)
Building wheels for collected packages: coincurve
  Building wheel for coincurve (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/myusername/.virtualenvs/the_python_env/bin/python /Users/myusername/.virtualenvs/the_python_env/lib/python3.10/site-packages/pip/_vendor/<randomstringhere>/in_process/_in_process.py build_wheel /var/folders/c8/<randomlongstringhere>/T/tmp3hrzw75j
       cwd: /private/var/folders/c8/<randomlongstringhere>/T/pip-install-a5b7q2fc/coincurve_5b4469bc42c942f78838439619ab6fd4
  Complete output (79 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-12.1-arm64-3.10
  creating build/lib.macosx-12.1-arm64-3.10/coincurve
  copying coincurve/_windows_libsecp256k1.py -> build/lib.macosx-12.1-arm64-3.10/coincurve
  copying coincurve/flags.py -> build/lib.macosx-12.1-arm64-3.10/coincurve
  copying coincurve/__init__.py -> build/lib.macosx-12.1-arm64-3.10/coincurve
  copying coincurve/keys.py -> build/lib.macosx-12.1-arm64-3.10/coincurve
  copying coincurve/types.py -> build/lib.macosx-12.1-arm64-3.10/coincurve
  copying coincurve/context.py -> build/lib.macosx-12.1-arm64-3.10/coincurve
  copying coincurve/utils.py -> build/lib.macosx-12.1-arm64-3.10/coincurve
  copying coincurve/ecdsa.py -> build/lib.macosx-12.1-arm64-3.10/coincurve
  copying coincurve/py.typed -> build/lib.macosx-12.1-arm64-3.10/coincurve
  running build_clib
  configure.ac:28: warning: The macro `AC_PROG_CC_C89' is obsolete.
  configure.ac:28: You should run autoupdate.
  ./lib/autoconf/c.m4:1652: AC_PROG_CC_C89 is expanded from...
  configure.ac:28: the top level
  configure.ac:26: installing 'build-aux/compile'
  configure.ac:5: installing 'build-aux/config.guess'
  configure.ac:5: installing 'build-aux/config.sub'
  configure.ac:9: installing 'build-aux/install-sh'
  configure.ac:9: installing 'build-aux/missing'
  Makefile.am:3: error: Libtool library used but 'LIBTOOL' is undefined
  Makefile.am:3:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
  Makefile.am:3:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
  Makefile.am:3:   If 'LT_INIT' is in 'configure.ac', make sure
  Makefile.am:3:   its definition is in aclocal's search path.
  Makefile.am: installing 'build-aux/depcomp'
  parallel-tests: installing 'build-aux/test-driver'
  autoreconf: error: automake failed with exit status: 1
  Traceback (most recent call last):
    File "/Users/myusername/.virtualenvs/the_python_env/lib/python3.10/site-packages/pip/_vendor/<randomstringhere>/in_process/_in_process.py", line 363, in <module>
      main()
    File "/Users/myusername/.virtualenvs/the_python_env/lib/python3.10/site-packages/pip/_vendor/<randomstringhere>/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/myusername/.virtualenvs/the_python_env/lib/python3.10/site-packages/pip/_vendor/<randomstringhere>/in_process/_in_process.py", line 261, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 230, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
      self.run_setup()
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 267, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 262, in <module>
      setup(
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 155, in setup
      return distutils.core.setup(**attrs)
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
      return run_commands(dist)
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
      dist.run_commands()
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
      self.run_command(cmd)
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
      cmd_obj.run()
    File "setup.py", line 97, in run
      _bdist_wheel.run(self)
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
      cmd_obj.run()
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/private/var/folders/c8/<randomlongstringhere>/T/pip-build-env-<randomstringhere>/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
      cmd_obj.run()
    File "setup.py", line 154, in run
      subprocess.check_call([autogen], cwd=absolute('libsecp256k1'))
    File "/Users/myusername/.pyenv/versions/3.10.1/lib/python3.10/subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/private/var/folders/c8/<randomlongstringhere>/T/pip-install-a5b7q2fc/coincurve_5b4469bc42c942f78838439619ab6fd4/libsecp256k1/autogen.sh']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for coincurve
Failed to build coincurve
ERROR: Could not build wheels for coincurve, which is required to install pyproject.toml-based projects
(the_python_env) myusername@My-MacBook-Pro my_project % 

Btw, I have to actually build this project from source, I can't just use the wheel pre-compiled binary version of it cached in pypi.

python

pip

pypi

0 Answers

Your Answer

Accepted video resources