python-lzo icon indicating copy to clipboard operation
python-lzo copied to clipboard

Installation failure

Open majunze2001 opened this issue 2 years ago • 10 comments

I am using macOS Monterey 12.2.1 on M1 chip and the installation failed.

Building wheels for collected packages: python-lzo Building wheel for python-lzo (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [12 lines of output] running bdist_wheel running build running build_ext building 'lzo' extension creating build creating build/temp.macosx-10.14-arm64-3.8 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/usr/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c lzomodule.c -o build/temp.macosx-10.14-arm64-3.8/lzomodule.o lzomodule.c:37:10: fatal error: 'lzo/lzo1x.h' file not found #include <lzo/lzo1x.h> ^~~~~~~~~~~~~ 1 error generated. error: command 'clang' failed with exit status 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for python-lzo Running setup.py clean for python-lzo Failed to build python-lzo Installing collected packages: python-lzo Running setup.py install for python-lzo ... error error: subprocess-exited-with-error

× Running setup.py install for python-lzo did not run successfully. │ exit code: 1 ╰─> [12 lines of output] running install running build running build_ext building 'lzo' extension creating build creating build/temp.macosx-10.14-arm64-3.8 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/usr/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c lzomodule.c -o build/temp.macosx-10.14-arm64-3.8/lzomodule.o lzomodule.c:37:10: fatal error: 'lzo/lzo1x.h' file not found #include <lzo/lzo1x.h> ^~~~~~~~~~~~~ 1 error generated. error: command 'clang' failed with exit status 1 [end of output]

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

× Encountered error while trying to install package. ╰─> python-lzo

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

majunze2001 avatar Mar 17 '22 21:03 majunze2001

Same issue on osx 12.3.1/M1

damian-adelaide avatar Apr 26 '22 18:04 damian-adelaide

same issue here, on AppVeyor Mac image.

1over137 avatar May 02 '22 12:05 1over137

same issue

link-ding avatar May 06 '22 07:05 link-ding

I think I know the solution. You need to first brew install lzo to get the library headers.

1over137 avatar May 06 '22 12:05 1over137

I already install lzo in my computer by using brew install lzo. image

link-ding avatar May 06 '22 13:05 link-ding

same

Lindanvdw avatar May 19 '22 14:05 Lindanvdw

same issue here

OlivierLaflamme avatar May 24 '22 21:05 OlivierLaflamme

CFLAGS=-I$(brew --prefix)/include LDFLAGS=-L$(brew --prefix)/lib pip3 install python-lzo

blluv avatar Jun 02 '22 13:06 blluv

That worked for me. Thank you!

damian-adelaide avatar Jun 02 '22 13:06 damian-adelaide

Now getting import error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/lzo.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '___lzo_init_v2'

damian-adelaide avatar Aug 02 '22 16:08 damian-adelaide

So, why not upload wheel pkg to pypi ?

see https://github.com/jd-boyd/python-lzo/issues/23#issuecomment-1515670434

ruanimal avatar Apr 20 '23 03:04 ruanimal