1
votes

I'm trying to install IElixir Jupyter notebook kernel on Xubuntu 16.04. I've successfully done it before on another machine with Xubuntu 16.04.

I have the latest erlang otp 19.3 and elixir 1.4.4 (installed using kiex).

After executing mix test i get an error about undefined :erlzmq_nif.context/1 function:

** (Mix) Could not start application ielixir: exited in: IElixir.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function :erlzmq_nif.context/1 is undefined (module :erlzmq_nif is not available)
            :erlzmq_nif.context(1)
            (ielixir) lib/ielixir.ex:13: IElixir.start/2
            (kernel) application_master.erl:273: :application_master.start_it_old/4

The thing is all the dependencies are succesfully installed and I am able to use :erlzmq_nif.context/1 in iex:

iex(1)> :erlzmq_nif.context 1
{:ok, ""}
iex(2)> 

I've copied my build of erlzmq to /usr/lib/erlang/lib so that I can use it in erlang too:

1> erlzmq_nif:context(3).
{ok,<<>>}
2> 

Why is this lib not visible to elixir when using mix?

1
check your elixirc_paths/1 functions in mix.exs. There should be a clause for :text and a default. Make sure the :test clause is pulling in the correct paths.Steve Pallen
Do you have this library set to be dependency only for dev?PatNowak
@StevePallen there is no elixirrc_paths/1 function in mix.exs. @PatNowak no, it's set as a general dependency, just like here: github.com/pprzetacznik/IElixir/blob/master/mix.exs#L28.adam

1 Answers

0
votes

I've not solved the problem, bu I've manage to get IElixir to work.

What I've done was replace :erlzmq dependency in mix.exs with github: "zeromq/erlzmq" (notice no 2 in the repo name) which might not outperform erlzmq2 as it's not NIF based, but at least it works without problems.