# Cannot get the NLopt example to work

**URL:** https://discourse.julialang.org/t/cannot-get-the-nlopt-example-to-work/17539
**Category:** General Usage
**Tags:** optimization
**Created:** [November 14, 2018, 11:35pm UTC](https://discourse.julialang.org/t/cannot-get-the-nlopt-example-to-work/17539 "2018-11-14T23:35:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CPPhysics](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cpphysics/32/4372_2.png) [@CPPhysics](https://discourse.julialang.org/u/CPPhysics)
#### Post date: [November 14, 2018, 11:35pm UTC](https://discourse.julialang.org/t/cannot-get-the-nlopt-example-to-work/17539/1 "2018-11-14T23:35:32Z")

</div>

I am trying to get the NLopt main example from the github page to work and I cannot. When I try on julia .6.2 I get this error:

```julia
type Opt has no field numevals

Stacktrace:
 [1] include_string(::String, ::String) at .\loading.jl:522
 [2] execute_request(::ZMQ.Socket, ::IJulia.Msg) at C:\Users\cpeac\.julia\v0.6\IJulia\src\execute_request.jl:193
 [3] (::Compat.#inner#6{Array{Any,1},IJulia.#execute_request,Tuple{ZMQ.Socket,IJulia.Msg}})() at C:\Users\cpeac\.julia\v0.6\Compat\src\Compat.jl:189
 [4] eventloop(::ZMQ.Socket) at C:\Users\cpeac\.julia\v0.6\IJulia\src\eventloop.jl:8
 [5] (::IJulia.##13#16)() at .\task.jl:335 

```

And when I try on juliabox 1.0.0 I get this error:

```julia
UndefVarError: optimize not defined

Stacktrace:
 [1] top-level scope at In[7]:26

```

If anyone can help please let me know.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [November 15, 2018, 12:23am UTC](https://discourse.julialang.org/t/cannot-get-the-nlopt-example-to-work/17539/2 "2018-11-15T00:23:07Z")

</div>

> [@CPPhysics](#):
>
> When I try on julia .6.2 I get this error:

The latest version of NLopt (the one described in the README) requires Julia 0.7 or later.

The README for the last version supported under Julia 0.6 is here: [https://github.com/JuliaOpt/NLopt.jl/blob/78a635d334b51dd6ab696bb7d2670973e794846e/README.md](https://github.com/JuliaOpt/NLopt.jl/blob/78a635d334b51dd6ab696bb7d2670973e794846e/README.md)

> And when I try on juliabox 1.0.0 I get this error:

I can’t reproduce the error message — I just tried, and the tutorial example works fine for me in Julia 1.0. Did `using NLopt` succeed? (i.e. have you actually installed the NLopt package successfully?)

---

<div class="post-metadata">

### Author: ![CPPhysics](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cpphysics/32/4372_2.png) [@CPPhysics](https://discourse.julialang.org/u/CPPhysics)
#### Post date: [November 18, 2018, 11:05pm UTC](https://discourse.julialang.org/t/cannot-get-the-nlopt-example-to-work/17539/3 "2018-11-18T23:05:52Z")

</div>

Hello,

Okay thank you, I was using juliabox and it said the package was already installed and on top of that I added the package again and it seemed to work as it was supposed to. However I just restarted it a few times and started a new notebook and now it works so I’m sorry to have bothered you i guess I just needed to fiddle with it.

Thanks again
