masaccio / numbers-parser

Python module for parsing Apple Numbers .numbers files
MIT License
208 stars 15 forks source link

Error installing package #8

Closed walmer-bolfet closed 2 years ago

walmer-bolfet commented 2 years ago

I don't know what it means but got this error trying to install this package. Thanks for looking at it.

ERROR: Command errored out with exit status 1: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/pc/3r24mm_j7vj7pbsccb25x9fh0000gn/T/pip-install-6xw1j_pi/python-snappy/setup.py'"'"'; file='"'"'/private/var/folders/pc/3r24mm_j7vj7pbsccb25x9fh0000gn/T/pip-install-6xw1j_pi/python-snappy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/pc/3r24mm_j7vj7pbsccb25x9fh0000gn/T/pip-record-t9m3oii6/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/paul/Library/Python/3.8/include/python3.8/python-snappy Check the logs for full command output.

masaccio commented 2 years ago

python-snappy is a library from Google that is required to decompress the Numbers files and looks like it’s failing to install for some reason. What version of macOS are you using (Apple Menu, choose About This Mac)? I’d also check that Software Update doesn’t have newer versions of Xcode.

Aside from that you can get more verbose errors and also the errors from python-snappy alone with:

python3 -m pip —verbose —log ~/Desktop/pip.log install python-snappy

This will create a log file on your desktop that might have some clues.

walmer-bolfet commented 2 years ago

Thank you for looking into this. I am working a large numbers workbook that would work better if numbers had the feature to link to spreadsheets in other workbooks. I am manually importing and hoped I could automate with your package. I am working on a MacMini (M1, 2020) with macOS Monterey. I am pretty sure I have the latest version of Xcode (13.2.1).
I installed snappy with Homebrew without error when I first encountered the issues of needing snappy. With your suggestion to install python-snappy alone - system returned: “ERROR: Failed building wheel for python-snappy” In addition to the same error that I provided above. Any way ahead for me that you can suggest? Thank you again.

masaccio commented 2 years ago

Does the log file have anything obvious in it such as compiler errors? There's a --debug switch on pip as well though I've never tried it. I'm wondering whether Python packages in Homebrew are conflicting with system packages? I have an M1 Mac too and I eventually switched to Homebrew managed Python (currently 3.10) and I only have Home-brew install the Python interpreter. All the Python packages I install via pip

walmer-bolfet commented 2 years ago

There is more in the pip.log file than I understand. Have attached it, wherein I found reference to:

 ‘ snappy/snappymodule.cc:32:10: fatal error: 'snappy-c.h' file not found ‘ 
  #include <snappy-c.h>

What I found on google about it has not taught me where to include the snappy-c.h file. Do you have insights?

pip.log

masaccio commented 2 years ago

Yep that’s clear to me. Snappy is compiled and has a Python wrapper. It’s failing to install because the libraries are not installed. There is an answer here:

https://stackoverflow.com/questions/22794807/installing-avro-in-mac-os-x

I should probably figure out how to ensure the library is installed properly though in theory the Python library should have done that. It works in the Travis CI environment so I will check that

Jon

walmer-bolfet commented 2 years ago

Thank you for your help. I will close this as not an issue with your package. I have taken your advice and moved to Homebrew managed Python where the package install correctly.