Install Mosek.jl

I tried Pkg.add(“Mosek”) to add Mosek package but I got the following error " unknown package Mosek". I have no idea why I have received this error. Please let me know if you have been in the same situation.

Do you have a Mosek license? And if so, what directory is it stored in?

Adding Mosek requires a license to use it, but it seems your issue is before even building / compiling. Do you have more info?

I have already used Mosek in Yalmip and it works very well. However, I add Mosek.jl to use in julia but I received an error, after reinstalling Mosek I got the " unknown package Mosek" error.

You may need to run Pkg.update() first.

I got the following error: Module SparseArrays not found in current path. Run ‘Pkg.add(“SparseArrays”)’ to install the SparseArrays pakage.

I tried to install the pakage while I got the following error:
unknown Package SparseArrays

Please let me know if I have done something wrong in installation process?

What’s the output of Pkg.status() and versioninfo()?

Mosek 0.0.0 non-repo (unregistered)
version 0.6.4

Try nuking your v0.6 package installation:

rm(Pkg.dir(), recursive=true); Pkg.status(); Pkg.add("Mosek")

Please copy and paste terminal output (surrounded by triple backticks, ```) into Discourse rather than posting screenshots.

Can you navigate to https://www.mosek.com/downloads/default_dns.txt in your browser?

If you know where Yalmip installed its Mosek binaries, you can also point Mosek.jl to that directory by setting the MOSEKBINDIR environment variable to that location, then running Pkg.build("Mosek").

Sorry for the inconvenience! I did what you mentioned in your last post and it seems that Mosek works at this time. However, I got the following warning which I appreciate if you guide me to debug.

WARNING: requiring "SOS_envelopes" in module "Main" did not define a corresponding module.

What command did you run to produce that output? In general, it’s good to provide as much context as you can when you ask questions so that readers can more easily duplicate the conditions that caused the problem (i.e. a minimum working example).

I used “using SOS_envelopes” to run the code. Following is the SOS_envelopes code that I have written to compute the best set of (a, b, and c).


using MultivariatePolynomials

using JuMP

using PolyJuMP

using SumOfSquares

using DynamicPolynomials

using Mosek

using SemialgebraicSets

@polyvar x

m = SOSModel(solver = MosekSolver())

@variable m a

@variable m b

@variable m c

epsilon = 0.001;  x_min = -pi/2;  x_max = pi/2;

P= a*x^2 + b*x + c - 1 + x^2/factorial(2) - x^4/factorial(4) + x^6/factorial(6) - x^8/factorial(8) + x^10/factorial(10) - epsilon;

S = @set x >= -pi/2 && x <= pi/2

x_max=pi/2;

x_min=-pi/2;

@objective m Min (1/3*a*x_max^3 + 1/2*b*x_max^2 + c*x_max+sin(x_max) - 1/3*a*x_min^3 + 1/2*b*x_min^2 + c*x_min+sin(x_min));

@constraint( m, P >= 0, domain = S)

If you want to run the contents of some file SOS_envelopes.jl, use include("/path/to/SOS_envelopes.jl").

Thank you so much!