fury icon indicating copy to clipboard operation
fury copied to clipboard

Mac install using “conda install -c conda-forge pyarrow” command is completed, how to set pyarrow of environment variables?

Open 69567272 opened this issue 1 year ago • 2 comments

Error in fail: Python Configuration Error: Problem getting pyarrow include path. Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'pyarrow' Is the Python binary path set up right? (See ./configure or python3.) Is distutils installed? ERROR: no such package '@@local_config_pyarrow//': Python Configuration Error: Problem getting pyarrow include path. Traceback (most recent call last):

How solve this compilation error?

69567272 avatar May 22 '24 14:05 69567272

Occur same question. But I find why My complete log:

(fury) urlyy@urlyy-mbp python % conda activate fury
(fury) urlyy@urlyy-mbp python % pip install -v -e .
Using pip 24.2 from /Users/urlyy/environment/miniconda/envs/fury/lib/python3.8/site-packages/pip (python 3.8)
Obtaining file:///Users/urlyy/workspace/fury/python
  Running command python setup.py egg_info
  Loading:
  Loading:
  Loading: 0 packages loaded
  Analyzing: target //:cp_fury_so (0 packages loaded, 0 targets configured)
  DEBUG: /Users/urlyy/workspace/fury/bazel/arrow/pyarrow_configure.bzl:169:10: python3 -c 'import pyarrow;print(pyarrow.get_include())'
  INFO: Repository local_config_pyarrow instantiated at:
    /Users/urlyy/workspace/fury/WORKSPACE:38:18: in <toplevel>
  Repository rule pyarrow_configure defined at:
    /Users/urlyy/workspace/fury/bazel/arrow/pyarrow_configure.bzl:267:36: in <toplevel>
  ERROR: An error occurred during the fetch of repository 'local_config_pyarrow':
     Traceback (most recent call last):
        File "/Users/urlyy/workspace/fury/bazel/arrow/pyarrow_configure.bzl", line 214, column 44, in _pyarrow_pip_impl
                arrow_header_dir = _get_pyarrow_include(repository_ctx, python_bin)
        File "/Users/urlyy/workspace/fury/bazel/arrow/pyarrow_configure.bzl", line 170, column 22, in _get_pyarrow_include
                result = _execute(
        File "/Users/urlyy/workspace/fury/bazel/arrow/pyarrow_configure.bzl", line 41, column 14, in _execute
                _fail("\n".join([
        File "/Users/urlyy/workspace/fury/bazel/arrow/pyarrow_configure.bzl", line 9, column 9, in _fail
                fail("%sPython Configuration Error:%s %s\n" % (red, no_color, msg))
  Error in fail: Python Configuration Error: Problem getting pyarrow include path.
  return code: 1
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  ModuleNotFoundError: No module named 'pyarrow'

I insert a log line, so there is an output:DEBUG: /Users/urlyy/workspace/fury/bazel/arrow/pyarrow_configure.bzl:169:10: python3 -c 'import pyarrow;print(pyarrow.get_include())' Image

and if I just use the command:

(fury) urlyy@urlyy-mbp python % python3 -c 'import pyarrow;print(pyarrow.get_include())' 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pyarrow'

(fury) urlyy@urlyy-mbp python % python -c 'import pyarrow;print(pyarrow.get_include())' 
/Users/urlyy/environment/miniconda/envs/fury/lib/python3.8/site-packages/pyarrow/include

(fury) urlyy@urlyy-mbp python % which python3
/usr/bin/python3

(fury) urlyy@urlyy-mbp python % which python
/Users/urlyy/environment/miniconda/envs/fury/bin/python

So the reason is my python environment config is wrong. Or I can just remove line 210 shown as below:

Image

However, I still can't build on Mac

@chaokunyang

(fury) urlyy@urlyy-mbp python % conda activate fury
(fury) urlyy@urlyy-mbp python % pip install -v -e .
......
......
ERROR: /Users/urlyy/workspace/fury/cpp/fury/util/BUILD:3:11: Compiling cpp/fury/util/buffer.cc failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //cpp/fury/util:fury_util) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 35 arguments skipped)

  Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
  clang: error: unsupported option '-mavx2' for target 'arm64-apple-darwin24.4.0'
  Target //:cp_fury_so failed to build
  Use --verbose_failures to see the command lines of failed build steps.
  INFO: Elapsed time: 2.569s, Critical Path: 1.83s
  INFO: 31 processes: 11 internal, 20 darwin-sandbox.
  FAILED: Build did NOT complete successfully
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/Users/urlyy/workspace/fury/python/setup.py", line 69, in <module>
      subprocess.check_call(["bazel", "build", "-s", "//:cp_fury_so"])
    File "/Users/urlyy/environment/miniconda/envs/fury/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['bazel', 'build', '-s', '//:cp_fury_so']' returned non-zero exit status 1.

The reason is clang: error: unsupported option '-mavx2' for target 'arm64-apple-darwin24.4.0'. Seems to be a SIMD instruction set is not compatible on MAC.

Image

urlyy avatar Apr 27 '25 09:04 urlyy

This should be fixed by #2330

esafak avatar Jul 06 '25 21:07 esafak