lupa icon indicating copy to clipboard operation
lupa copied to clipboard

ERROR: Failed building wheel for lupa

Open ryanding-dev opened this issue 6 years ago • 11 comments

I followed this guide to install lupa on my Mac, but something went wrong. WeWork Helper20191009163347

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.

ryanding-dev avatar Oct 09 '19 08:10 ryanding-dev

Does it work without the -pagezero_size ? Doc update appreciated once you've found out how to make it work for you.

scoder avatar Oct 12 '19 08:10 scoder

I am having the same problem. It would be nice to have a feedback on this one. Up.

rafspiny avatar Nov 14 '19 19:11 rafspiny

Same issue +1

davix avatar Nov 26 '19 08:11 davix

See my comment above.

scoder avatar Dec 21 '19 10:12 scoder

brew uninstall lua brew uninstall luajit pip install lupa

1sEyeRainLife avatar Mar 01 '20 06:03 1sEyeRainLife

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

ericson-cepeda avatar Mar 11 '20 22:03 ericson-cepeda

Hi @scoder it actually did work when I ran the clang command without the -pagezero_size.. whoohoo! thanks :)

kfirstri avatar Apr 16 '20 09:04 kfirstri

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

RakibFiha avatar Aug 17 '20 02:08 RakibFiha

This ticket seems to be mixing two issues.

  1. -pagezero_size may 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.

  2. 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.

scoder avatar Aug 17 '20 05:08 scoder

Instead of 2.0, using LuaJIT 2.1 works for me

  1. brew uninstall [--ignore-dependencies] luajit
  2. brew install luajit --HEAD
  3. pip install lupa

ryanding-dev avatar Sep 18 '20 08:09 ryanding-dev

brew uninstall lua brew uninstall luajit pip install lupa

This is what I had to do on Mac Big Sur 11.6

mswezey23 avatar Dec 20 '21 23:12 mswezey23