Hi,
Has anyone experienced issues when trying to run python3 install_requirements.py in Big Sur OS.
Seems like the problem is related to the numpy library. However, I was able to install numpy through home brew and did not get the same error.
Happened on Big Sur running on a M1 chip
Here is the error log:
Requirement already satisfied: pip in /opt/homebrew/lib/python3.9/site-packages (20.3.3)
WARNING: Skipping depthai as it is not installed.
Ignoring open3d: markers 'platform_machine != "armv7l" and python_version < "3.9"' don't match your environment
Collecting argcomplete==1.12.1
Using cached argcomplete-1.12.1-py2.py3-none-any.whl (38 kB)
Collecting depthai==0.4.0.0
Using cached depthai-0.4.0.0.tar.gz (84 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting numpy==1.19.3
Using cached numpy-1.19.3.zip (7.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: /opt/homebrew/opt/[email protected]/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/tmp60t7dj_s
cwd: /private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651
Complete output (217 lines):
Running from numpy source directory.
setup.py:480: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
Processing numpy/random/_bounded_integers.pxd.in
Processing numpy/random/_philox.pyx
Processing numpy/random/_bounded_integers.pyx.in
Processing numpy/random/_sfc64.pyx
Processing numpy/random/_mt19937.pyx
Processing numpy/random/bit_generator.pyx
Processing numpy/random/mtrand.pyx
Processing numpy/random/_generator.pyx
Processing numpy/random/_pcg64.pyx
Processing numpy/random/_common.pyx
Cythonizing sources
blas_opt_info:
blas_mkl_info:
customize UnixCCompiler
libraries mkl_rt not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
blis_info:
libraries blis not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
openblas_info:
libraries openblas not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_3_10_blas_info:
libraries satlas not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
accelerate_info:
libraries accelerate not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
Library accelerate was not found. Ignoring
libraries veclib not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
Library veclib was not found. Ignoring
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
non-existing path in 'numpy/distutils': 'site.cfg'
lapack_opt_info:
lapack_mkl_info:
libraries mkl_rt not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
openblas_lapack_info:
libraries openblas not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
openblas_clapack_info:
libraries openblas,lapack not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
flame_info:
libraries flame not found in ['/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
libraries lapack_atlas not found in /opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries tatlas,tatlas not found in /opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries lapack_atlas not found in /usr/local/lib
libraries tatlas,tatlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/lib
libraries tatlas,tatlas not found in /usr/lib
libraries lapack_atlas not found in /opt/local/lib
libraries tatlas,tatlas not found in /opt/local/lib
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
libraries lapack_atlas not found in /opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries satlas,satlas not found in /opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries lapack_atlas not found in /usr/local/lib
libraries satlas,satlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/lib
libraries satlas,satlas not found in /usr/lib
libraries lapack_atlas not found in /opt/local/lib
libraries satlas,satlas not found in /opt/local/lib
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
libraries lapack_atlas not found in /opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries ptf77blas,ptcblas,atlas not found in /opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries lapack_atlas not found in /usr/local/lib
libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/lib
libraries ptf77blas,ptcblas,atlas not found in /usr/lib
libraries lapack_atlas not found in /opt/local/lib
libraries ptf77blas,ptcblas,atlas not found in /opt/local/lib
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
libraries lapack_atlas not found in /opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries f77blas,cblas,atlas not found in /opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries lapack_atlas not found in /usr/local/lib
libraries f77blas,cblas,atlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/lib
libraries f77blas,cblas,atlas not found in /usr/lib
libraries lapack_atlas not found in /opt/local/lib
libraries f77blas,cblas,atlas not found in /opt/local/lib
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
running dist_info
running build_src
build_src
building py_modules sources
creating build
creating build/src.macosx-11-arm64-3.9
creating build/src.macosx-11-arm64-3.9/numpy
creating build/src.macosx-11-arm64-3.9/numpy/distutils
building library "npymath" sources
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 157, in prepare_metadata_for_build_wheel
self.run_setup()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 248, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 508, in <module>
setup_package()
File "setup.py", line 500, in setup_package
setup(**metadata)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/command/dist_info.py", line 31, in run
egg_info.run()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/egg_info.py", line 24, in run
self.run_command("build_src")
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/build_src.py", line 144, in run
self.build_sources()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/build_src.py", line 155, in build_sources
self.build_library_sources(*libname_info)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/build_src.py", line 288, in build_library_sources
sources = self.generate_sources(sources, (lib_name, build_info))
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/build_src.py", line 378, in generate_sources
source = func(extension, build_dir)
File "numpy/core/setup.py", line 658, in get_mathlib_info
st = config_cmd.try_link('int main(void) { return 0;}')
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/config.py", line 241, in try_link
self._check_compiler()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/config.py", line 80, in _check_compiler
self.fcompiler = new_fcompiler(compiler=self.fcompiler,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 880, in new_fcompiler
compiler = get_default_fcompiler(plat, requiref90=requiref90,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 851, in get_default_fcompiler
compiler_type = _find_existing_fcompiler(matching_compiler_types,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 802, in _find_existing_fcompiler
c.customize(dist)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 526, in customize
linker_so_flags = self.flag_vars.linker_so
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/environment.py", line 37, in __getattr__
return self._get_var(name, conf_desc)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/environment.py", line 53, in _get_var
var = self._hook_handler(name, hook)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 705, in _environment_hook
return hook()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/gnu.py", line 346, in get_flags_linker_so
flags = GnuFCompiler.get_flags_linker_so(self)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/gnu.py", line 136, in get_flags_linker_so
os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 684, in __setitem__
value = self.encodevalue(value)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 756, in encode
raise TypeError("str expected, not %s" % type(value).__name__)
TypeError: str expected, not int
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/homebrew/opt/[email protected]/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/tmp60t7dj_s Check the logs for full command output.
Traceback (most recent call last):
File "/Users/sebastianvillalobos/Sabana Tech/smartaccess/depthai/install_requirements.py", line 17, in
subprocess.check_call([*pip_install, "-r", "requirements.txt"])
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/homebrew/opt/[email protected]/bin/python3.9', '-m', 'pip', 'install', '--user', '-r', 'requirements.txt']' returned non-zero exit status 1.
Hi @esbasti ,
I have not seen this. But I do have something that might be helpful. Here is what we did to get development working on M1 Macs:
https://discuss.luxonis.com/d/69-running-depthai-on-apple-m1-based-macs
The why is that some development tools don't yet run natively on M1 Macs.
Thoughts?
Thanks,
Brandon
Thank you @Luxonis-Brandon for getting back to me.
I tried running the terminal under Rosetta.
But, unfortunately I'm still getting the same error.
Got it. Just to make sure I'm on the same page, have you already run the following (from here)?
sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
If you haven't please do close and re-open the terminal after doing so, and run python3 -m pip install -U pip, which should show something like:
Requirement already satisfied: pip in /Users/leeroy/Library/Python/3.9/lib/python/site-packages (20.3.3) if it is already updated.
And I want to share this video in case it's helpful in getting up/going:
https://www.youtube.com/watch?v=0RGmmjed3Hc&feature=youtu.be
Unfortunately I don't have an M1 Mac on hand (I really want to get one) to try out, otherwise I could see about reproducing. @alex-luxonis does have one.
Thanks for the video, it was very helpful
I was skipping the python3 -m pip install depthai
Notheless I get a new error when running this command.
I think this time the error is caused by home brew. I tried to run homebrew under rosetta 2. But, still got the same error
`Collecting depthai
Using cached depthai-0.4.0.0.tar.gz (84 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: depthai
Building wheel for depthai (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /opt/homebrew/opt/[email protected]/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/tmp8m4hw9u7
cwd: /private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-gfgg7o6b/depthai_16754c96838549f286e1b6e8543b1e04
Complete output (58 lines):
running bdist_wheel
running build
running build_ext
Traceback (most recent call last):
File "setup.py", line 72, in run
out = subprocess.check_output(['cmake', '--version'])
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 420, in check_output
return run(popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 501, in run
with Popen(popenargs, **kwargs) as process:
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1819, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in
main()
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(hook_input['kwargs'])
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 204, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-j9ot46yy/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 216, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-j9ot46yy/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
self.run_setup()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-j9ot46yy/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 253, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-j9ot46yy/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 159, in
setup(
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-j9ot46yy/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-j9ot46yy/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 74, in run
raise RuntimeError("CMake must be installed to build the following extensions: " +
RuntimeError: CMake must be installed to build the following extensions: depthai
ERROR: Failed building wheel for depthai
Failed to build depthai
ERROR: Could not build wheels for depthai which use PEP 517 and cannot be installed directly
DarkCloud:~ sebastianvillalobos$
`
I saw that one once as well. Can you close the terminal, re-open, and run python3 -m pip install -U pip ? And then try python3 -m pip install depthai again?
Oh, and sorry. cmake wasn't installed somehow.
Can you do brew install cmake?
Hi @esbasti,
This doesn't seem good:
Collecting depthai
Using cached depthai-0.4.0.0.tar.gz (84 kB)
It tries to build the wheel from sources (.tar.gz), while a prebuilt wheel should have been used instead. It might be because the command was ran initially natively (not under Rosetta 2).
Could you open a terminal under Rosetta and confirm that the command uname -m returns x86_64. Then try:
python3 -m pip uninstall depthai -y
python3 -m pip install depthai --no-cache-dir
I'm getting this output on Apple M1 with python 3.9.1.5:
Collecting depthai
Downloading depthai-0.4.0.0-cp39-cp39-macosx_10_9_x86_64.whl (2.9 MB)
|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 2.9 MB 2.8 MB/s
Installing collected packages: depthai
Successfully installed depthai-0.4.0.0
Hi @alex-luxonis thanks for looking into this as well
I can confirm you that after running the command uname -m returns x86_64
Notheless, when i run python3 -m pip uninstall depthai -y got the following warning
WARNING: Skipping depthai as it is not installed.
And when run python3 -m pip install depthai --no-cache-dir
Here is the error log
Collecting depthai
Downloading depthai-0.4.0.0.tar.gz (84 kB)
|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 84 kB 1.1 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: depthai
Building wheel for depthai (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /opt/homebrew/opt/[email protected]/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/tmp1j88zm3u
cwd: /private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-z9ezgcns/depthai_80f01c8fd1bd4f0e9e1397038bb4394c
Complete output (58 lines):
running bdist_wheel
running build
running build_ext
Traceback (most recent call last):
File "setup.py", line 72, in run
out = subprocess.check_output(['cmake', '--version'])
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 420, in check_output
return run(popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 501, in run
with Popen(popenargs, **kwargs) as process:
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1819, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in
main()
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(hook_input['kwargs'])
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 204, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-v7n7tw5c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 216, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-v7n7tw5c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
self.run_setup()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-v7n7tw5c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 253, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-v7n7tw5c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 159, in
setup(
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-v7n7tw5c/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-v7n7tw5c/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 74, in run
raise RuntimeError("CMake must be installed to build the following extensions: " +
RuntimeError: CMake must be installed to build the following extensions: depthai
ERROR: Failed building wheel for depthai
Failed to build depthai
ERROR: Could not build wheels for depthai which use PEP 517 and cannot be installed directly
@esbasti Thanks for trying out the commands.
So after I installed Homebrew and then the other packages (python3, etc) under Rosetta, later on even when running in a native arm64 terminal, I still got the prebuilt x86_64 depthai wheel getting downloaded and installed by pip.
I also upgraded to the latest Big Sur (11.1), but all was still fine.
I'm reinstalling macOS now, and trying to see if I could get to reproduce your situation, where the build from sources is always attempted. This will take some time...
Just in case, if you haven't already, could you try closing and reopening terminal consoles and maybe also rebooting. Sometimes changes done by installed programs (altering PATH or other environment variables) don't take effect otherwise.
If still no improvement, could you try the command that Brandon suggested brew install cmake and see if the build from sources gets to work.
@esbasti So I erased and reinstalled Big Sur on my Mac M1, then did these:
Opened Terminal and executed this dependencies install script from our website:
https://docs.luxonis.com/en/latest/pages/api/#installing-system-dependencies
sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
Then ran python3 -m pip install depthai and was greeted with the same situation you encountered: it downloaded the .tar.gz and attempted the wheel build, failing.
Opened another Terminal under Rosetta 2:
Get Info -> ticked Open using Rosetta. Then trying to open it prompted me to install Rosetta, and after that I was able to open it.python3 -m pip install depthai and was prompted with the same situation and error.sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bashpython3 -m pip install depthai , still with no luck. brew install cmake didn't helped.Opened again Terminal under Rosetta 2:
python3 -m pip install depthai and at this point it worked as expected, downloading the _x86_64.whlNext I cloned this repo, ran python3 install_requirements.py, then python3 depthai_demo.py, all working well.
I highlighted in bold the steps from above that I believe helped. Let us know how it goes on your side.
Still not luck.
Tried the steps above
And after running the command python3 -m pip install depthai I'm still getting the error below
Also thought it may had to do something with how I installed Brew and Rosetta and try this:
But it still fails
Collecting depthai
Using cached depthai-0.4.0.0.tar.gz (84 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: depthai
Building wheel for depthai (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /opt/homebrew/opt/[email protected]/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/tmpdhhq0zr1
cwd: /private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-3_8q08vt/depthai_77ef299d5c9e4ed49dbfa03c1413b776
Complete output (143 lines):
running bdist_wheel
running build
running build_ext
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [hunter] Calculating Toolchain-SHA1
-- [hunter] Calculating Config-SHA1
-- [hunter] HUNTER_ROOT: /Users/sebastianvillalobos/.hunter
-- [hunter] [ Hunter-ID: 062a19a | Toolchain-ID: 5e27f7a | Config-ID: 2a6efb3 ]
-- [hunter] NLOHMANN_JSON_ROOT: /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Install (ver.: 3.8.0)
-- Found nlohmann_json: /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Install/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.8.0")
-- [hunter] NLOHMANN_JSON_SCHEMA_VALIDATOR_ROOT: /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Install (ver.: 2.1.1)
-- [hunter] XLINK_ROOT: /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Install (ver.: luxonis-2020.2)
-- [hunter] Building XLink
loading initial cache file /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/cache.cmake
loading initial cache file /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/args.cmake
CMake Error: Could not open file for write in copy operation /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/Build/XLink-Release-prefix/src/XLink-Release-stamp/XLink-Release-urlinfo.txt.tmp
CMake Error: : System Error: Permission denied
CMake Error at /opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:2661 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:3430 (_ep_add_download_command)
CMakeLists.txt:152 (ExternalProject_Add)
CMake Error: Could not open file for write in copy operation /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/Build/XLink-Release-prefix/src/XLink-Release-stamp/download-XLink-Release.cmake.tmp
CMake Error: : System Error: Permission denied
CMake Error at /opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:1448 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:2717 (_ep_write_downloadfile_script)
/opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:3430 (_ep_add_download_command)
CMakeLists.txt:152 (ExternalProject_Add)
CMake Error at /opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:2726 (file):
file failed to open for writing (Permission denied):
/Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/Build/XLink-Release-prefix/src/XLink-Release-stamp/verify-XLink-Release.cmake
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:3430 (_ep_add_download_command)
CMakeLists.txt:152 (ExternalProject_Add)
CMake Error at /opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:1492 (file):
file failed to open for writing (Permission denied):
/Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/Build/XLink-Release-prefix/src/XLink-Release-stamp/extract-XLink-Release.cmake
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:2739 (_ep_write_extractfile_script)
/opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:3430 (_ep_add_download_command)
CMakeLists.txt:152 (ExternalProject_Add)
CMake Error: Could not open file for write in copy operation /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/Build/XLink-Release-prefix/tmp/XLink-Release-cfgcmd.txt.tmp
CMake Error: : System Error: Permission denied
CMake Error at /opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:3135 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.19.2/share/cmake/Modules/ExternalProject.cmake:3433 (_ep_add_configure_command)
CMakeLists.txt:152 (ExternalProject_Add)
-- Configuring incomplete, errors occurred!
See also "/Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/Build/CMakeFiles/CMakeOutput.log".
See also "/Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/Build/CMakeFiles/CMakeError.log".
CMake Error: Cannot open file for write: /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/Build/CMakeCache.txt.tmp541c5
CMake Error: : System Error: Permission denied
CMake Error: Unable to open cache file for save. /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink/Build/CMakeCache.txt
CMake Error: : System Error: Permission denied
[hunter * FATAL ERROR *] Configure step failed (dir: /Users/sebastianvillalobos/.hunter/_Base/062a19a/5e27f7a/2a6efb3/Build/XLink)
[hunter * FATAL ERROR *] [Directory:/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-3_8q08vt/depthai_77ef299d5c9e4ed49dbfa03c1413b776/depthai-core]
------------------------------ ERROR -----------------------------
https://hunter.readthedocs.io/en/latest/reference/errors/error.external.build.failed.html
CMake Error at /Users/sebastianvillalobos/.hunter/_Base/Download/Hunter/0.23.258/062a19a/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
/Users/sebastianvillalobos/.hunter/_Base/Download/Hunter/0.23.258/062a19a/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
/Users/sebastianvillalobos/.hunter/_Base/Download/Hunter/0.23.258/062a19a/Unpacked/cmake/modules/hunter_download.cmake:597 (hunter_fatal_error)
/Users/sebastianvillalobos/.hunter/_Base/Download/Hunter/0.23.258/062a19a/Unpacked/cmake/modules/hunter_add_package.cmake:53 (hunter_download)
depthai-core/CMakeLists.txt:36 (hunter_add_package)
-- Configuring incomplete, errors occurred!
See also "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-3_8q08vt/depthai_77ef299d5c9e4ed49dbfa03c1413b776/build/temp.macosx-11-arm64-3.9/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-3_8q08vt/depthai_77ef299d5c9e4ed49dbfa03c1413b776/build/temp.macosx-11-arm64-3.9/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in
main()
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(hook_input['kwargs'])
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 204, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-nno8ee5o/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 216, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-nno8ee5o/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
self.run_setup()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-nno8ee5o/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 253, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-nno8ee5o/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 159, in
setup(
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-nno8ee5o/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-nno8ee5o/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 83, in run
self.build_extension(ext)
File "setup.py", line 154, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "/opt/homebrew/Cellar/[email protected]/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-3_8q08vt/depthai_77ef299d5c9e4ed49dbfa03c1413b776', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-3_8q08vt/depthai_77ef299d5c9e4ed49dbfa03c1413b776/build/lib.macosx-11-arm64-3.9/', '-DPYTHON_EXECUTABLE=/opt/homebrew/Cellar/[email protected]/3.9.1_5/bin/python3.9', '-DCMAKE_BUILD_TYPE=Release', '-DHUNTER_CONFIGURATION_TYPES=Release']' returned non-zero exit status 1.
ERROR: Failed building wheel for depthai
Failed to build depthai
ERROR: Could not build wheels for depthai which use PEP 517 and cannot be installed directly
@esbasti I was able to build the depthai wheel from sources under native arm64, after adding the Homebrew install to PATH manually: export PATH=/opt/homebrew/bin:$PATH. I also had to brew install cmake libusb.
I also see from your logs above that the build was progressing, but reaching some permission issues in ~/.hunter directory. I believe this happens because the command was ran at some point with sudo (sudo python3 -m pip install depthai). Maybe you could resolve the problem by deleting this directory entirely: sudo rm -rf ~/.hunter (should be safe to do that, Hunter is a source-code-level package manager we use for builds).
But anyway, this isn't the right direction for fixing the problem (at least for now), as some python libraries are still not supported under native Apple M1. Most prominent is numpy, that we depend on for depthai. So for now we need to stay with the x86_64 translation, and thus should get the prebuilt to work (and don't even attempt build from sources):
python3 -m pip install --only-binary=:all: --no-cache-dir depthai
To check directly under which platform python3 runs: python3 -c "import platform; print(platform.platform())" :
macOS-11.1-arm64-i386-64bit - bad, nativemacOS-11.1-x86_64-i386-64bit - OK, with emulationIn your case it must be something with the Homebrew install. Could you check the PATH env var echo $PATH , and if by any chance /opt/homebrew is included, remove it.
And if the problem persists, maybe even remove completely Homebrew, running in a native terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"/opt/homebrewarch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"/usr/localAnd then reinstall with this command under Rosetta:
sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
followed by closing and reopening the terminal.
Finally I was able to install all dependencies successfully and run the demo.
What ended up working was what @alex-luxonis suggested. Which was:
And if the problem persists, maybe even remove completely Homebrew, running in a native terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
--should remove it from /opt/homebrew
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
--should remove it from /usr/local
And then reinstall with this command under Rosetta:
sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
followed by closing and reopening the terminal.
In addition to running this commands I had to manually delete the Homebrew directory in both locations.
Thank you both for taking the time and troubleshoot for a solution @Luxonis-Brandon @alex-luxonis
Glad it's working and thanks for circling back!
Thanks! Closing as resolved.
We also updated the install script for macOS, it can be run now on M1 without having to run the terminal under Rosetta (it will automatically prefix certain commands with arch -x86_64):
https://docs.luxonis.com/en/latest/pages/api/#macos
The DepthAI API and examples (gen2_develop branch) run fine natively on M1 by the way, once you get native OpenCV for Python installed (I built it from source weeks ago, but it should be possible to install it now using conda via conda-forge) as well as Numpy (also using conda-forge).
We were thinking to recommend users to run under Rosetta, until opencv-python, numpy, etc. get to a stable state on M1 arm64, or at least could be built from sources with pip. As the performance under x86_64 translation seems pretty good anyway.
But we could look at conda-forge. Thanks!
I have been using M1-native only development tools since day 1 (early December) and so far Homebrew and Conda-forge have provided all the packages I needed, and in the worse cases building from sources has not been an issue at all.
Thanks, both. And good to know @whabilly . The M1 chips are so impressive. Cool to see computer innovation like this. Before the M1, it seemed computer processors weren't -really- getting any faster in terms of daily user experience.
Most helpful comment
I have been using M1-native only development tools since day 1 (early December) and so far Homebrew and Conda-forge have provided all the packages I needed, and in the worse cases building from sources has not been an issue at all.