noirello / pyorc

Python module for Apache ORC file format
Apache License 2.0
64 stars 21 forks source link

Cannot install pyorc on Mac M1 #52

Closed liiight closed 2 years ago

liiight commented 2 years ago

First of all, thank you very much for this amazing package, it's super useful!

I'm afraid I'm unable to install it on MacOS 12.3.1 Apple chip, via python 3.10.4:

source /Users/ocarmi/PycharmProjects/shield/venv/bin/activate
pip install pyorc
Collecting pyorc
  Using cached pyorc-0.6.0.tar.gz (54 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyorc
  Building wheel for pyorc (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyorc (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      running bdist_wheel
      running build
      running build_py
      running egg_info
      writing pyorc.egg-info/PKG-INFO
      writing dependency_links to pyorc.egg-info/dependency_links.txt
      writing requirements to pyorc.egg-info/requires.txt
      writing top-level names to pyorc.egg-info/top_level.txt
      reading manifest file 'pyorc.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.css' under directory 'docs'
      warning: no previously-included files matching '*' found under directory 'docs/_build'
      adding license file 'LICENSE'
      running build_ext
      error: HTTP Error 404: Not Found
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyorc
Failed to build pyorc
ERROR: Could not build wheels for pyorc, which is required to install pyproject.toml-based projects
noirello commented 2 years ago

As the output shows, no M1 compatible wheel is available (though, there's a chance it will be soon), thus it tries to install it from source. The setup.py's build_ext command automatically downloads and compiles the ORC C++ Core library, but since the last release, a new one has been released (1.7.4) and the old one (1.7.3, which module tries to download) has been moved to a different location. Hence the 404 HTTP error.

The build_ext command has some extra flags (--orc-version and --source-url) that you can use to either change the orc lib version to download or set the new URL for the old library. Pip also has some flags (--install-option and --global-option) that I believe could be used to pass options to setup.py's build_ext, but unfortunately it doesn't seem to work (or at least I failed to use it for this particular purpose).

So you have to download the package's source and run the build_ext with the flags manually:

pip download pyorc
tar xzf pyorc-0.6.0.tar.gz && cd pyorc-0.6.0
python3 setup.py build_ext --orc-version=1.7.4 # Or python3 setup.py build_ext --source-url=https://archive.apache.org/dist/orc/
python3 setup.py install
liiight commented 2 years ago

Thanks, installing from source per your instruction indeed work. Thank for the swift response and solution! I appreciate your hard work on this project!