ERROR: Failed building wheel for lupa
I followed this guide to install lupa on my Mac, but something went wrong.

Any help? Thanks!
Environment: Lua version 5.3.5 Pip version 19.2.3 Python version 3.7.4 macOS Mojave version 10.14.6
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Error Information:
Collecting lupa
Using cached https://files.pythonhosted.org/packages/7f/73/b26eb44603dc47e32b9a308e15cdf613aa3eeba073004d11572182e5df92/lupa-1.8.tar.gz
Building wheels for collected packages: lupa
Building wheel for lupa (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/dyk/.local/share/virtualenvs/forseti-be-Eii2dWp2/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-install-qn61jdpx/lupa/setup.py'"'"'; __file__='"'"'/private/var/folders/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-install-qn61jdpx/lupa/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-wheel-3eqqvcrh --python-tag cp37
cwd: /private/var/folders/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-install-qn61jdpx/lupa/
Complete output (34 lines):
No local build of LuaJIT2 found in lupa directory
Checking for installed luajit library using pkg-config
pkg-config found luajit version 2.0.5
building without Cython
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/lupa
copying lupa/version.py -> build/lib.macosx-10.14-x86_64-3.7/lupa
copying lupa/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/lupa
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'lupa._lupa' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/lupa
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -arch x86_64 -DCYTHON_CLINE_IN_TRACEBACK=0 -I/usr/local/Cellar/luajit/2.0.5/include/luajit-2.0 -I/Users/dyk/.pyenv/versions/3.7.4/include/python3.7m -c lupa/_lupa.c -o build/temp.macosx-10.14-x86_64-3.7/lupa/_lupa.o
lupa/_lupa.c:3058:38: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
__pyx_t_1 = ((__pyx_v_self->_owner != PyThread_get_thread_ident()) != 0);
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
lupa/_lupa.c:3271:38: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
__pyx_t_1 = ((__pyx_v_self->_owner != PyThread_get_thread_ident()) != 0);
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
lupa/_lupa.c:3363:59: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
__pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->_owner == PyThread_get_thread_ident())); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error)
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/dyk/.pyenv/versions/3.7.4/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/dyk/.pyenv/versions/3.7.4/lib -arch x86_64 build/temp.macosx-10.14-x86_64-3.7/lupa/_lupa.o -L/usr/local/Cellar/luajit/2.0.5/lib -pagezero_size 10000 -image_base 100000000 -lluajit-5.1 -o build/lib.macosx-10.14-x86_64-3.7/lupa/_lupa.cpython-37m-darwin.so
ld: -pagezero_size option can only be used when linking a main executable
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for lupa
Running setup.py clean for lupa
Failed to build lupa
Installing collected packages: lupa
Running setup.py install for lupa ... error
ERROR: Command errored out with exit status 1:
command: /Users/dyk/.local/share/virtualenvs/forseti-be-Eii2dWp2/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-install-qn61jdpx/lupa/setup.py'"'"'; __file__='"'"'/private/var/folders/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-install-qn61jdpx/lupa/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/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-record-nq2min2_/install-record.txt --single-version-externally-managed --compile --install-headers /Users/dyk/.local/share/virtualenvs/forseti-be-Eii2dWp2/include/site/python3.7/lupa
cwd: /private/var/folders/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-install-qn61jdpx/lupa/
Complete output (34 lines):
No local build of LuaJIT2 found in lupa directory
Checking for installed luajit library using pkg-config
pkg-config found luajit version 2.0.5
building without Cython
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/lupa
copying lupa/version.py -> build/lib.macosx-10.14-x86_64-3.7/lupa
copying lupa/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/lupa
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'lupa._lupa' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/lupa
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -arch x86_64 -DCYTHON_CLINE_IN_TRACEBACK=0 -I/usr/local/Cellar/luajit/2.0.5/include/luajit-2.0 -I/Users/dyk/.pyenv/versions/3.7.4/include/python3.7m -c lupa/_lupa.c -o build/temp.macosx-10.14-x86_64-3.7/lupa/_lupa.o
lupa/_lupa.c:3058:38: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
__pyx_t_1 = ((__pyx_v_self->_owner != PyThread_get_thread_ident()) != 0);
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
lupa/_lupa.c:3271:38: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
__pyx_t_1 = ((__pyx_v_self->_owner != PyThread_get_thread_ident()) != 0);
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
lupa/_lupa.c:3363:59: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
__pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->_owner == PyThread_get_thread_ident())); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error)
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/dyk/.pyenv/versions/3.7.4/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/dyk/.pyenv/versions/3.7.4/lib -arch x86_64 build/temp.macosx-10.14-x86_64-3.7/lupa/_lupa.o -L/usr/local/Cellar/luajit/2.0.5/lib -pagezero_size 10000 -image_base 100000000 -lluajit-5.1 -o build/lib.macosx-10.14-x86_64-3.7/lupa/_lupa.cpython-37m-darwin.so
ld: -pagezero_size option can only be used when linking a main executable
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/dyk/.local/share/virtualenvs/forseti-be-Eii2dWp2/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-install-qn61jdpx/lupa/setup.py'"'"'; __file__='"'"'/private/var/folders/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-install-qn61jdpx/lupa/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/b2/nysw_c157hj6ps63l4sb9p880000gn/T/pip-record-nq2min2_/install-record.txt --single-version-externally-managed --compile --install-headers /Users/dyk/.local/share/virtualenvs/forseti-be-Eii2dWp2/include/site/python3.7/lupa Check the logs for full command output.
Does it work without the -pagezero_size ?
Doc update appreciated once you've found out how to make it work for you.
I am having the same problem. It would be nice to have a feedback on this one. Up.
Same issue +1
See my comment above.
brew uninstall lua brew uninstall luajit pip install lupa
brew uninstall lua brew uninstall luajit pip install lupa
Error: Refusing to uninstall /usr/local/Cellar/lua/5.3.5_1
because it is required by vim, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies lua
Error: Refusing to uninstall /usr/local/Cellar/luajit/2.0.5
because it is required by neovim, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies luajit
Hi @scoder it actually did work when I ran the clang command without the -pagezero_size.. whoohoo! thanks :)
brew uninstall lua brew uninstall luajit pip install lupa
Has worked for me.
brew uninstall --ignore-dependencies lua luajit && pip install lupa && pip3 install lupa && brew install lua luajit
This ticket seems to be mixing two issues.
-
-pagezero_sizemay be required or may fail the build, I don't know. It's a MacOS thing, to be solved by MacOS users. PR/explanation/links welcome. -
Does it build with an installed Lua/LuaJIT or not. It seems better and less intrusive to explicitly use the bundled Lua version by passing the environment variable
LUPA_USE_BUNDLE=true, than to uninstall and reinstall a library that other applications depend on.
Instead of 2.0, using LuaJIT 2.1 works for me
- brew uninstall [--ignore-dependencies] luajit
- brew install luajit --HEAD
- pip install lupa
brew uninstall lua brew uninstall luajit pip install lupa
This is what I had to do on Mac Big Sur 11.6