thisisparker / xword-dl

⬛⬜⬛ Command line tool to scrape crosswords from online solvers and save them as .puz files ⬛⬜⬛
MIT License
140 stars 30 forks source link

Mac install questions #135

Closed mixographer closed 8 months ago

mixographer commented 8 months ago

Does anyone know how to install this on a mac? I get a lot of errors where the gist of it is that the .egg is not a directory. I don't know what that means, but neither pip or setup.py can install this on my mac.

File "", line 627, in _load_backward_compatible File "", line 259, in load_module File "/Library/Python/3.9/site-packages/xword_dl-2023.9.5-py3.9.egg/xword_dl/xword_dl.py", line 20, in NotADirectoryError: [Errno 20] Not a directory: '/Library/Python/3.9/site-packages/xword_dl-2023.9.5-py3.9.egg/xword_dl/version'

mixographer commented 8 months ago

If I start with a new 3.12 python, I can get a little further, but I can't build lxml.

Failed to build lxml ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects

and it seems to come down to errors from clang

clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -arch arm64 -arch x86_64 -g -DCYTHON_CLINE_IN_TRACEBACK=0 -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -Isrc -Isrc/lxml/includes -I/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c src/lxml/etree.c -o build/temp.macosx-10.9-universal2-cpython-312/src/lxml/etree.o -w -flat_namespace src/lxml/etree.c:119231:29: error: call to undeclared function 'PyUnicode_GET_DATA_SIZE'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] pyx_v_py_buffer_len = PyUnicode_GET_DATA_SIZE(pyx_v_utext); ^ src/lxml/etree.c:119240:22: error: call to undeclared function 'PyUnicode_AS_DATA'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] pyx_v_c_text = PyUnicode_AS_DATA(pyx_v_utext); ^ src/lxml/etree.c:119240:22: note: did you mean 'PyUnicode_DATA'? /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/unicodeobject.h:261:21: note: 'PyUnicode_DATA' declared here static inline void PyUnicode_DATA(PyObject op) { ^ src/lxml/etree.c:125820:23: error: call to undeclared function 'PyUnicode_GET_DATA_SIZE'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] pyx_v_c_len = PyUnicode_GET_DATA_SIZE(pyx_v_text); ^ src/lxml/etree.c:262394:36: error: no member named 'curexc_traceback' in 'struct _ts' PyObject* tmp_tb = tstate->curexc_traceback;


src/lxml/etree.c:262397:21: error: no member named 'curexc_traceback' in 'struct _ts'
tstate->curexc_traceback = tb;
~~~~~~  ^
src/lxml/etree.c:263340:53: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)op1)->ob_digit;
~~~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:263457:53: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)op1)->ob_digit;
~~~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:264135:22: error: call to undeclared function '_PyUnicode_Ready'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (unlikely(__Pyx_PyUnicode_READY(uval)))
^
src/lxml/etree.c:668:51: note: expanded from macro '__Pyx_PyUnicode_READY'
0 : _PyUnicode_Ready((PyObject *)(op)))
^
src/lxml/etree.c:264135:22: note: did you mean '_PyUnicode_Copy'?
src/lxml/etree.c:668:51: note: expanded from macro '__Pyx_PyUnicode_READY'
0 : _PyUnicode_Ready((PyObject *)(op)))
^
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/unicodeobject.h:400:23: note: '_PyUnicode_Copy' declared here
PyAPI_FUNC(PyObject*) _PyUnicode_Copy(
^
src/lxml/etree.c:264651:22: error: call to undeclared function '_PyUnicode_Ready'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
^
src/lxml/etree.c:668:51: note: expanded from macro '__Pyx_PyUnicode_READY'
0 : _PyUnicode_Ready((PyObject *)(op)))
^
src/lxml/etree.c:265182:53: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)op1)->ob_digit;
~~~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:265286:18: error: call to undeclared function '_PyUnicode_Ready'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL;
^
src/lxml/etree.c:668:51: note: expanded from macro '__Pyx_PyUnicode_READY'
0 : _PyUnicode_Ready((PyObject *)(op)))
^
src/lxml/etree.c:267536:55: error: no member named 'gi_code' in 'PyGenObject'
if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
~~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:267536:104: error: no member named 'gi_code' in 'PyGenObject'
if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
~~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:268588:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:268643:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:268897:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:268952:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:269093:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~  ^
src/lxml/etree.c:269148:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Compile failed: command '/usr/bin/clang' failed with exit code 1
creating var
creating var/folders
creating var/folders/j5
creating var/folders/j5/fsgyqw6955v8tjyt4lg4wn440000gn
creating var/folders/j5/fsgyqw6955v8tjyt4lg4wn440000gn/T
cc -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/include/libxml2 -c /var/folders/j5/fsgyqw6955v8tjyt4lg4wn440000gn/T/xmlXPathInitesegi3m9.c -o var/folders/j5/fsgyqw6955v8tjyt4lg4wn440000gn/T/xmlXPathInitesegi3m9.o
cc var/folders/j5/fsgyqw6955v8tjyt4lg4wn440000gn/T/xmlXPathInitesegi3m9.o -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lxml2 -o a.out
error: command '/usr/bin/clang' failed with exit code 1
[end of output]

 note: This error originates from a subprocess, and is likely not a problem with pip.

ERROR: Failed building wheel for lxml
  Running setup.py clean for lxml
Failed to build lxml
ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects
mixographer commented 8 months ago

I don't know how I fixed this, but it was my problem. I think individually installing each dependencie in requirements.txt, and then changing the dependencies to require the version I had of certain packages solved it. For instance requirements.txt asks for lxml == 4.9.2 so I changed it to lxml == 4.9.3. I did this for all the libraries required and then I was able to run it.