lupa icon indicating copy to clipboard operation
lupa copied to clipboard

installation fails with luajit from homebrew

Open kmike opened this issue 10 years ago • 6 comments

Hi,

Thanks for an awesome project!

I'm installing lupa into 2.7 virtualenv on OS X 10.9.5. The following seems to work fine:

brew install lua
pip install lupa

It detects lua 5.2.3, builds fine and examples from readme work.

With

brew install luajit
pip install lupa

it correctly detects luajit 2.0.3 and builds without errors, but lupa doesn't work:

>>> import lupa
>>> lupa.LuaRuntime()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "lupa/_lupa.pyx", line 147, in lupa._lupa.LuaRuntime.__cinit__ (lupa/_lupa.c:2906)
lupa._lupa.LuaError: Failed to initialise Lua runtime
>>> 

From the install instructions it is unclear if it should ever work, but since non-jit lua seems to work maybe there is a way to make lupa work with homebrew-installed luajit too?

kmike avatar Oct 11 '14 02:10 kmike

Might be the usual 64bit MacOS-X problem with LuaJIT described here: https://github.com/scoder/lupa/blob/master/INSTALL.rst

scoder avatar Oct 11 '14 05:10 scoder

Interesting.. A workaround suggested in the the linked blogpost is to build a custom Python with the following flags:

-pagezero_size 10000 -image_base 100000000

I'll stick to non-jit lua for now. Thanks!

kmike avatar Oct 11 '14 15:10 kmike

Having the same issue OS X 10.10.2

Fast workaround when error happened: (for those who came here from google and want to try lupa)

brew uninstall luajit      
pip uninstall lupa
pip install lupa
brew install luajit    

In result we have lua, luajit and lupa=(python+lua)

Currently lupa doesn't work with luajit on OSX at all.

@scoder Could you please change installation for OS X users in order to don't even try luajit without special flags? Its better to work on "simple" lua then having fun with manual setup.

akaRem avatar Mar 05 '15 13:03 akaRem

I take pull requests.

scoder avatar Mar 05 '15 17:03 scoder

Using luajit version greater than 2.1.0-beta3 with GC64 option enabled solve the issue. Currently, brew install luajit --devel --with-gc64 installs 2.1.0-beta3.

hodduc avatar Jun 25 '18 05:06 hodduc

updating @hodduc command line for installing luajit: brew install luajit --HEAD

pedrokiefer avatar Jan 23 '19 11:01 pedrokiefer