pip install ocean-lib not working on M1, coincurve error
Describe the bug The newest version of ocean-lib is not installing correctly (on M1 Mac).
I followed the installation described in the main README, (started with wheel, no errors, then ocean-lib).
running
pip install wheel
pip install --pre ocean-lib
throws this error:
Collecting base58
Using cached base58-2.1.1-py3-none-any.whl (5.6 kB)
Building wheels for collected packages: coincurve
Building wheel for coincurve (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for coincurve (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [68 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-11.0-arm64-cpython-38
creating build/lib.macosx-11.0-arm64-cpython-38/coincurve
copying coincurve/_windows_libsecp256k1.py -> build/lib.macosx-11.0-arm64-cpython-38/coincurve
copying coincurve/flags.py -> build/lib.macosx-11.0-arm64-cpython-38/coincurve
copying coincurve/__init__.py -> build/lib.macosx-11.0-arm64-cpython-38/coincurve
copying coincurve/keys.py -> build/lib.macosx-11.0-arm64-cpython-38/coincurve
copying coincurve/types.py -> build/lib.macosx-11.0-arm64-cpython-38/coincurve
copying coincurve/context.py -> build/lib.macosx-11.0-arm64-cpython-38/coincurve
copying coincurve/utils.py -> build/lib.macosx-11.0-arm64-cpython-38/coincurve
copying coincurve/ecdsa.py -> build/lib.macosx-11.0-arm64-cpython-38/coincurve
copying coincurve/py.typed -> build/lib.macosx-11.0-arm64-cpython-38/coincurve
running build_clib
/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-install-cwcgtxj4/coincurve_d253ec3e991a49e6965de219c367e821/libsecp256k1/autogen.sh: line 3: autoreconf: command not found
Traceback (most recent call last):
File "/Users/jakub/miniconda3/envs/ocean-test/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/Users/jakub/miniconda3/envs/ocean-test/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/jakub/miniconda3/envs/ocean-test/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 244, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 229, in _build_with_temp_dir
self.run_setup()
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 281, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in run_setup
exec(code, locals())
File "<string>", line 260, in <module>
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 177, in setup
return run_commands(dist)
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 193, in run_commands
dist.run_commands()
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
self.run_command(cmd)
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "<string>", line 95, in run
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 317, in run_command
self.distribution.run_command(command)
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/command/build.py", line 24, in run
super().run()
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 131, in run
self.run_command(cmd_name)
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 317, in run_command
self.distribution.run_command(command)
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-build-env-oz111gih/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "<string>", line 152, in run
File "/Users/jakub/miniconda3/envs/ocean-test/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/private/var/folders/vc/5b_s57r96czcz93nfrdkmhwc0000gn/T/pip-install-cwcgtxj4/coincurve_d253ec3e991a49e6965de219c367e821/libsecp256k1/autogen.sh']' returned non-zero exit status 127.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
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
same result when running ARCHFLAGS="-arch x86_64" pip install ocean-lib
To Reproduce Steps to reproduce the behavior:
- run
conda create -n ocean-test -c conda-forge python=3.8 - run
pip install wheel - run
pip install --pre ocean-libORARCHFLAGS="-arch x86_64" pip install ocean-libORpip install ocean-lib - Note: behavior observed on M1 Mac
Expected behavior Ocean.py installs without error.
Desktop (please complete the following information):
- OS: macOS 12.3 (M1)
- Browser: N/A
Additional context Add any other context about the problem here.
I tried reproducing this on my Mac but the installation went smoothly. @md00ux any ideas?
Try https://github.com/ofek/coincurve/blob/f13612f377bfc857922364ae397789ff1e98c46d/.github/workflows/build.yml#L125
@ofek Thank you. Do you know how I can specify a flag for coincurve when I'm installing ocean-lib? Running pip install ocean-lib -target arm64-apple-macos11 throws an error
ERROR: Could not find a version that satisfies the requirement arm64-apple-macos11 (from versions: none)
Also, manually installing coincurve actually works for me, the error only appears when I try installing ocean-lib.
@smejak Are you still encountering this problem?
Hi @AnaLoznianu. Yes, I still cannot install ocean-lib on my computer, but I have been able to install it in a Docker container that I've been using for development.
Thanks for the update! @miquelcabot I remember you encountered a similar issue 🤔 Can you jump in and offer guidance please?
@AnaLoznianu @smejak I have reviewed this problem, and the similar issue was with the barge repository, because Docker don't have an elastic-search image for M1 chipsets. The error was:
Pulling elasticsearch (elasticsearch:6.8.3)...
6.8.3: Pulling from library/elasticsearch
ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries
Finally this was solved in Barge v4. This version uses elasticsearch version 7.14.2, which has support for linux/arm64 platform.
@smejak It's a weird issue, because I also use @oceanprotocol/lib library in a M1 Mac and it works fine for me.
@smejak are you still encountering this issue? Do you think we can close this issue?
I've had some trouble reinstalling coincurve on a fresh Ubuntu Jammy, but I fixed it by installing and upgrading pip and wheel, then with pip install coincurve --no-binary all. I think I also had to install some OS dependencies like libtool and autoconf, but otherwise it went ok.
@smejak I am closing this issue. If you encounter it again, please reopen it. Thank you 🙏
Hi @calina-c, thanks for the response, the command you sent works, but manually installing coincurve does not solve the error I get when installing ocean-lib, for some reason I'm still getting the same "Can't build wheel for coincurve error" even if it's already installed.
Is this the issue? https://github.com/ofek/coincurve/issues/111
Update: sorry, meant the closed one, updated link above
Hey @kremalicious, no the issue I'm getting is the error message above.