Skip to content

Commit

Permalink
deps/build.jl fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Jul 12, 2018
1 parent fd277d1 commit 688b411
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,53 @@ else
const PACKAGES = ["pyyaml", "matplotlib"]

try
info("Installing python pip using PyCall ...")
info("Checking for python pip using PyCall ...")
eval(:(@PyCall.pyimport pip))
catch e
print(e.msg)
println(e)
warn("Python pip is not installed!")
info("Downloading & installing python pip ...")
get_pip = joinpath(dirname(@__FILE__), "get-pip.py")
download("https://bootstrap.pypa.io/get-pip.py", get_pip)
run(`$(PyCall.python) $get_pip --user`)
rm("$get_pip")
end

eval(:(@PyCall.pyimport pip))
args = String[]
if haskey(ENV, "http_proxy")
push!(args, "--proxy")
push!(args, ENV["http_proxy"])
try
info("Installing Python YAML & MatPlotLib using pip ...")
eval(:(@PyCall.pyimport pip))
args = String[]
if haskey(ENV, "http_proxy")
push!(args, "--proxy")
push!(args, ENV["http_proxy"])
end
push!(args, "install")
push!(args, "--user")
append!(args, PACKAGES)
pip.main(args)
catch e
println(e)
warn("Installing Python YAML & MatPlotLib using pip fails!")
end
push!(args, "install")
push!(args, "--user")
append!(args, PACKAGES)

info("Installing Python YAML & MatPlotLib using pip ...")
pip.main(args)

try
eval(:(@PyCall.pyimport yaml))
info("Python pip YAML (pyyaml) is installed!")
catch e
print(e.msg)
warn("Python pip YAML (pyyaml) installation has failed! Using Conda instead ...")
println(e)
warn("Python pip YAML (pyyaml) installation has failed!")
info("Using Conda instead ...")
import Conda
Conda.add("pyyaml")
Conda.add("yaml")
end

try
eval(:(@PyCall.pyimport matplotlib))
info("Python pip MatPlotLib is installed!")
catch e
print(e.msg)
warn("Python pip MatPlotLib installation has failed! Using Conda instead ...")
println(e)
warn("Python pip MatPlotLib installation has failed!")
info("Using Conda instead ...")
import Conda
Conda.add("matplotlib")
end
Expand Down

0 comments on commit 688b411

Please sign in to comment.