# Mosek and Convex.jl -- Still not working

**URL:** <https://discourse.julialang.org/t/mosek-and-convex-jl-still-not-working/30254>\
**Category:** Optimization (Mathematical)\
**Created:** [October 24, 2019, 1:38am UTC](https://discourse.julialang.org/t/mosek-and-convex-jl-still-not-working/30254 "2019-10-24T01:38:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raktim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raktim/32/11188_2.png) [@raktim](https://discourse.julialang.org/u/raktim)\
**Post date:** [October 24, 2019, 1:38am UTC](https://discourse.julialang.org/t/mosek-and-convex-jl-still-not-working/30254/1 "2019-10-24T01:38:22Z")

</div>

I have been trying to use Convex with Mosek, but it seems there are still some errors. I have been trying to solve the following examples problem:

> using Convex, Mosek  
> m = 4; n = 5  
> A = randn(m, n); b = randn(m, 1)  
> x = Variable(n)  
> problem = minimize(sumsquares(A \* x - b), [x \>= 0])  
> solve!(problem, MosekSolver())

I get  
ERROR: UndefVarError: MosekSolver not defined

I know this is an old issue. Want to check if there are any new developments.  
Thanks.

---

<div class="post-metadata">

**Author:** ![blegat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blegat/32/217090_2.png) [@blegat](https://discourse.julialang.org/u/blegat)\
**Post date:** [October 24, 2019, 7:22am UTC](https://discourse.julialang.org/t/mosek-and-convex-jl-still-not-working/30254/2 "2019-10-24T07:22:51Z")

</div>

The new version of Mosek.jl dropped support from the MathProgBase interface.  
You have several choices here:

- Use MosekTools (the interface of Mosek to MathOptInterface) and the branch of Convex with experiemental support for MathOptInterface [https://github.com/JuliaOpt/Convex.jl/pull/330](https://github.com/JuliaOpt/Convex.jl/pull/330)
- Use an older version of Mosek.jl where MathProgBase was not dropped yet (note that this may mean that you use Mosek v8 instead of Mosek v9).
- Use JuMP v0.19 or v0.20 which uses MathOptInterface.

cc @ericphanson

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [October 24, 2019, 8:21am UTC](https://discourse.julialang.org/t/mosek-and-convex-jl-still-not-working/30254/3 "2019-10-24T08:21:24Z")

</div>

Yes, both those options should be working to use Mosek with Convex.jl— if something isn’t working with either please file an issue. (The MOI branch is indeed a work in progress, but it should only be missing warmstart support. But it definitely could have some bugs so keep that in mind and please let me know if you find any. It passes the tests at least 🙂).

---

<div class="post-metadata">

**Author:** ![raktim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raktim/32/11188_2.png) [@raktim](https://discourse.julialang.org/u/raktim)\
**Post date:** [October 24, 2019, 1:33pm UTC](https://discourse.julialang.org/t/mosek-and-convex-jl-still-not-working/30254/4 "2019-10-24T13:33:12Z")

</div>

Thanks! I will take a look at them and see how things go.  
Appreciate the fast response.
