Closed SheetJSDev closed 1 year ago
I'm unsurprised by the dependency on libmagic (I'll add it to the readme as a binary dependency) but poetry failing is a surprise. Seems like poetry has created an installer that relies upon poetry being installed.
So pip install poetry
is the obvious fix but really should not be required.
It's all clean in a virtual environment and sanitised PATH
% python3 -m venv venv-numbers-parser
% export PATH=/usr/bin:/bin
% source venv-numbers-parser/bin/activate
(venv-numbers-parser) % pip install numbers-parser
Collecting numbers-parser
Using cached numbers_parser-3.9.3-py3-none-any.whl (278 kB)
Collecting compact-json<2.0.0,>=1.1.3
Using cached compact_json-1.1.3-py3-none-any.whl
Collecting pendulum<3.0.0,>=2.1.2
Using cached pendulum-2.1.2-cp311-cp311-macosx_13_0_arm64.whl
Collecting protobuf<5.0.0,>=4.21.1
Using cached protobuf-4.21.9-cp37-abi3-macosx_10_9_universal2.whl (483 kB)
Collecting python-magic<0.5.0,>=0.4.27
Using cached python_magic-0.4.27-py2.py3-none-any.whl (13 kB)
Collecting python-snappy<0.7.0,>=0.6.1
Using cached python_snappy-0.6.1-cp311-cp311-macosx_13_0_arm64.whl
Collecting regex<2023.0.0,>=2022.9.13
Using cached regex-2022.10.31-cp311-cp311-macosx_11_0_arm64.whl (287 kB)
Collecting roman<4.0,>=3.3
Using cached roman-3.3-py2.py3-none-any.whl (3.9 kB)
Collecting python-dateutil<3.0,>=2.6
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytzdata>=2020.1
Using cached pytzdata-2020.1-py2.py3-none-any.whl (489 kB)
Collecting six>=1.5
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: python-snappy, six, roman, regex, pytzdata, python-magic, protobuf, compact-json, python-dateutil, pendulum, numbers-parser
Successfully installed compact-json-1.1.3 numbers-parser-3.9.3 pendulum-2.1.2 protobuf-4.21.9 python-dateutil-2.8.2 python-magic-0.4.27 python-snappy-0.6.1 pytzdata-2020.1 regex-2022.10.31 roman-3.3 six-1.16.0
[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: pip install --upgrade pip
I also sudo'd to a new shell and cleaned PATH to /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
and could pip install
without an error. Poetry is only installed in my home directory so I don't understand where your error comes from.
On libmagic, I've decided to remove the image_type
property since it's trivial for a caller to test this given the image data.
Sorry, I'm not a sophisticated coder. I'm in a venv. Python 3.9.12 Just FYI...
ImportError: failed to find libmagic. Check your installation
(landers) user@Users-Mac afterDan % pip install libmagic
Requirement already satisfied: libmagic in ./landers/lib/python3.9/site-packages (1.0)
Sorry, I'm not a sophisticated coder. I'm in a venv. Python 3.9.12 Just FYI...
ImportError: failed to find libmagic. Check your installation (landers) user@Users-Mac afterDan % pip install libmagic Requirement already satisfied: libmagic in ./landers/lib/python3.9/site-packages (1.0)
You don’t need libmagic unless you are running tests in a dev environment. It’s most easily installed using Homebrew on a Mac and is installed by default on Linux.
Also when you say you’re using venv, the dev environment uses Poetry to manage environments.
What were you looking to do?
Thanks, I'm experimenting with reading Mac .numbers files using pandas. That's where I got the error (in a virtual environment and using VS Code). I've since exported the .numbers file in an excel format and am not having issues.
Odd as I only use python-magic in tests. But if you do need it, you will need the binary library it depends upon which is where Homebrew is needed.
When trying to install globally (
sudo -H python3 -m pip install numbers_parser
) there were a few missing deps:1) the package depends on
poetry
. Installation error:Looking at the current tarball (https://files.pythonhosted.org/packages/8e/d4/d32d8935fc3a3fbe777e988925e3bf3b60e0daa45f7b9d8a7fe689f4fb84/numbers_parser-3.9.1.tar.gz) the setup.py does not reference poetry dependency:
2) the package depends on
libmagic
. Runtime error:This was resolved with
brew install libmagic
.