Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkg.build("Gurobi") problem for Gurobi in conda environment #316

Closed
changd opened this issue Apr 29, 2020 · 15 comments
Closed

Pkg.build("Gurobi") problem for Gurobi in conda environment #316

changd opened this issue Apr 29, 2020 · 15 comments

Comments

@changd
Copy link

changd commented Apr 29, 2020

I'm having trouble with Pkg.build("Gurobi"). Tried changing ["GUROBI_HOME"] to installation location but still does not work, so I'm wondering what possible issues are. Details:

I installed Gurobi using command line in a conda environment by following Steps 2-3 here: https://www.gurobi.com/gurobi-and-anaconda-for-linux/

Gurobi 9.0.2, Julia 1.0.3

The files gurobi_cl, gurobi.env, gurobi.sh (corresponds to Gurobi installation right?) are in: /home/changd/anaconda3/envs/virtual_env/bin/

So I set ["GUROBI_HOME"] = /home/changd/anaconda3/envs/virtual_env/bin/

gurobi.lic is in /home/changd/.

I think try "import Pkg" followed by "Pkg.build("Gurobi")", then receive the following error message:

┌ Error: Error building Gurobi:
│ ERROR: LoadError: Unable to locate Gurobi installation. If the advice above did not help,
│ open an issue at https://github.com/JuliaOpt/Gurobi.jl and post the full
│ print-out of this diagnostic attempt.

│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] top-level scope at /home/changd/.julia/packages/Gurobi/CI8ht/deps/build.jl:154
│ [3] include at ./boot.jl:317 [inlined]
│ [4] include_relative(::Module, ::String) at ./loading.jl:1044
│ [5] include(::Module, ::String) at ./sysimg.jl:29
│ [6] include(::String) at ./client.jl:392
│ [7] top-level scope at none:0
│ in expression starting at /home/changd/.julia/packages/Gurobi/CI8ht/deps/build.jl:152
│ Unable to locate Gurobi installation. Running some common diagnostics.

│ Gurobi.jl only supports the following versions:

│ - gurobi90
│ - gurobi81
│ - gurobi80
│ - gurobi75
│ - gurobi70

│ Did you download and install one of these versions from gurobi.com?


│ Found GUROBI_HOME = /home/changd/anaconda3/envs/virtual_env/bin/

│ Does this point to the correct install location?
│ - on Windows, this might be C:\Program Files\gurobi810\win64\
│ - alternatively, on Windows, this might be C:/Program Files/gurobi810/win64/
│ - on OSX, this might be /Library/gurobi810/mac64/
│ - on Unix, this might be /home/my_user/gurobi810/linux64/

│ Note: this has to be a full path, not a path relative to your current
│ directory or your home directory.

│ We're going to look for the Gurobi library in this directory:
│ /home/changd/anaconda3/envs/virtual_env/bin/lib

│ That directory has the following files:

│ Aha! We tried looking in /home/changd/anaconda3/envs/virtual_env/bin/lib, but something went wrong. Are
│ you sure that your GUROBI_HOME environment variable is correct?
│ When combined with the appropriate suffix (e.g., lib or
bin, it needs to point to a valid directory.

@odow
Copy link
Member

odow commented Apr 30, 2020

I've never tried Gurobi and Anaconda. Just install it normally. You need the following structure

$GUROBI_HOME/
    /lib
        gurobi90.so

@changd
Copy link
Author

changd commented Apr 30, 2020

I need to run Julia w/ Gurobi on a remote server. What do you mean by 'install it normally'? And by 'structure', do you mean: '/home/changd/anaconda3/envs/virtual_env/bin/lib/gurobi90.so'

@odow
Copy link
Member

odow commented Apr 30, 2020

What do you mean by 'install it normally'?

https://www.gurobi.com/documentation/9.0/quickstart_linux/software_installation_guid.html#section:Installation

And by 'structure', do you mean: '/home/changd/anaconda3/envs/virtual_env/bin/lib/gurobi90.so'

Yes.

Note that Gurobi.jl isn't officially supported by Gurobi.

@changd
Copy link
Author

changd commented May 1, 2020

Ok. Is this your suggestion for how to proceed (on a remote server):

  • Download and install the latest Julia version on the server (but not in a conda environment)
  • Download Gurobi, secure transfer download file to remote server, then extract contents and install on server

@odow
Copy link
Member

odow commented May 1, 2020

Yes, that seems sensible. Gurobi support may have a better way to do this; worth checking with them.

@changd
Copy link
Author

changd commented May 4, 2020

I will check that out with Gurobi support, thanks.

@changd
Copy link
Author

changd commented May 12, 2020

I updated my Gurobi installation, the Gurobi Python API appears to be functioning properly. Most likely there is not an issue on Gurobi's end.

However, now I get the following error message (see below) for Pkg.build("Gurobi"). I then tried Pkg.build("CodecZlib") but get a very similar error message.


Building CodecZlib ─→ ~/.julia/packages/CodecZlib/5t9zO/deps/build.log
┌ Error: Error building CodecZlib:
│ ERROR: LoadError: InitError: No download engines found. We looked for: curl, wget, fetch, busybox. Install one and ensure it is available on the path.
│ No compression engines found. We looked for: tar, busybox. Install one and ensure it is available on the path.

│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] #probe_platform_engines!#30(::Bool, ::Function) at /home/changd/.julia/packages/BinaryProvider/kcGxO/src/PlatformEngines.jl:407
│ [3] probe_platform_engines! at /home/changd/.julia/packages/BinaryProvider/kcGxO/src/PlatformEngines.jl:169 [inlined]
│ [4] init() at /home/changd/.julia/packages/BinaryProvider/kcGxO/src/BinaryProvider.jl:28
│ [5] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:633
│ [6] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:713
│ [7] _require(::Base.PkgId) at ./loading.jl:937
│ [8] require(::Base.PkgId) at ./loading.jl:858
│ [9] require(::Module, ::Symbol) at ./loading.jl:853
│ [10] include at ./boot.jl:317 [inlined]
│ [11] include_relative(::Module, ::String) at ./loading.jl:1044
│ [12] include(::Module, ::String) at ./sysimg.jl:29
│ [13] include(::String) at ./client.jl:392
│ [14] top-level scope at none:0
│ during initialization of module BinaryProvider
│ in expression starting at /home/changd/.julia/packages/CodecZlib/5t9zO/deps/build.jl:1
└ @ Pkg.Operations /home/conda/feedstock_root/build_artifacts/julia_1548684429855/work/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1097
Building MbedTLS ───→ ~/.julia/packages/MbedTLS/X4xar/deps/build.log
┌ Error: Error building MbedTLS:
│ ERROR: LoadError: InitError: No download engines found. We looked for: curl, wget, fetch, busybox. Install one and ensure it is available on the path.
│ No compression engines found. We looked for: tar, busybox. Install one and ensure it is available on the path.

│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] #probe_platform_engines!#30(::Bool, ::Function) at /home/changd/.julia/packages/BinaryProvider/kcGxO/src/PlatformEngines.jl:407
│ [3] probe_platform_engines! at /home/changd/.julia/packages/BinaryProvider/kcGxO/src/PlatformEngines.jl:169 [inlined]
│ [4] init() at /home/changd/.julia/packages/BinaryProvider/kcGxO/src/BinaryProvider.jl:28
│ [5] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:633
│ [6] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:713
│ [7] _require(::Base.PkgId) at ./loading.jl:937
│ [8] require(::Base.PkgId) at ./loading.jl:858
│ [9] require(::Module, ::Symbol) at ./loading.jl:853
│ [10] include at ./boot.jl:317 [inlined]
│ [11] include_relative(::Module, ::String) at ./loading.jl:1044
│ [12] include(::Module, ::String) at ./sysimg.jl:29
│ [13] include(::String) at ./client.jl:392
│ [14] top-level scope at none:0
│ during initialization of module BinaryProvider
│ in expression starting at /home/changd/.julia/packages/MbedTLS/X4xar/deps/build.jl:1
└ @ Pkg.Operations /home/conda/feedstock_root/build_artifacts/julia_1548684429855/work/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1097
Building CodecBzip2 → ~/.julia/packages/CodecBzip2/T5yr7/deps/build.log
┌ Error: Error building CodecBzip2:
│ ERROR: LoadError: InitError: No download engines found. We looked for: curl, wget, fetch, busybox. Install one and ensure it is available on the path.
│ No compression engines found. We looked for: tar, busybox. Install one and ensure it is available on the path.

│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] #probe_platform_engines!#30(::Bool, ::Function) at /home/changd/.julia/packages/BinaryProvider/kcGxO/src/PlatformEngines.jl:407
│ [3] probe_platform_engines! at /home/changd/.julia/packages/BinaryProvider/kcGxO/src/PlatformEngines.jl:169 [inlined]
│ [4] init() at /home/changd/.julia/packages/BinaryProvider/kcGxO/src/BinaryProvider.jl:28
│ [5] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:633
│ [6] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:713
│ [7] _require(::Base.PkgId) at ./loading.jl:937
│ [8] require(::Base.PkgId) at ./loading.jl:858
│ [9] require(::Module, ::Symbol) at ./loading.jl:853
│ [10] include at ./boot.jl:317 [inlined]
│ [11] include_relative(::Module, ::String) at ./loading.jl:1044
│ [12] include(::Module, ::String) at ./sysimg.jl:29
│ [13] include(::String) at ./client.jl:392
│ [14] top-level scope at none:0
│ during initialization of module BinaryProvider
│ in expression starting at /home/changd/.julia/packages/CodecBzip2/T5yr7/deps/build.jl:1
└ @ Pkg.Operations /home/conda/feedstock_root/build_artifacts/julia_1548684429855/work/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1097
Building Gurobi ────→ ~/.julia/packages/Gurobi/CI8ht/deps/build.log

@odow
Copy link
Member

odow commented May 13, 2020

ERROR: LoadError: InitError: No download engines found. We looked for: curl, wget, fetch, busybox. Install one and ensure it is available on the path.
│ No compression engines found. We looked for: tar, busybox. Install one and ensure it is available on the path.

Did you follow this instruction?

@changd
Copy link
Author

changd commented May 14, 2020

I installed busybox but I'm still getting the same error message. Message said "Install one and ensure it is available on the path." What "path" is being referred to // is this the most probable issue or is something else likely the problem?

@odow
Copy link
Member

odow commented May 14, 2020

What machine are you trying to install this on? Its linux but it doesn't have curl or tar?

The PATH environment variable:

http://www.linfo.org/path_env_var.html
https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path

@changd
Copy link
Author

changd commented May 14, 2020

This is a linux machine. Presumably it should have curl or tar but somehow I'm getting the above error message.

Where should I be installing busybox (or some similar counterpart)?

FYI:
ENV[“GUROBI_HOME”] = “/home/changd/gurobi902/linux64”
ENV["PATH"] = "/home/changd/gurobi902/linux64/bin"
ENV["LD_LIBRARY_PATH"] = "/home/changd/gurobi902/linux64/lib"

echo $PATH:
/home/changd/anaconda3/bin:/home/changd/anaconda3/condabin:/usr/lib64/qt-3.3/bin:/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/dell/srvadmin/bin:/home/changd/.local/bin:/home/changd/bin

I installed busybox in "/home/changd" which appears to be problematic.

@odow
Copy link
Member

odow commented May 15, 2020

Try

ENV["PATH"] = ENV["PATH"] * ":/home/changd"
import Pkg
Pkg.build("Gurobi")

Or move busy box into /home/changd/bin.

Do you really not have curl or tar in /usr/bin? What distro? Is this a VM? Or a server? You might need to contact your sysadmin.

@changd
Copy link
Author

changd commented May 15, 2020

I checked ‘home/changd/anaconda3/bin’, where I found curl but not tar. I do not have a folder of the form ‘home/changd/bin’.. (I’m working on a server) I will check this with the sysadmin.

I updated ENV["PATH"] = ENV["PATH"] * ":/home/changd/anaconda3/bin"

I also moved busy box into /home/changd/anaconda3/bin.

The original error message was:
"No download engines found. We looked for: curl, wget, fetch, busybox. Install one and ensure it is available on the path.
│ No compression engines found. We looked for: tar, busybox. Install one and ensure it is available on the path."

Now a download engine was found (curl), but not a compression engine (they did not find busybox).

I wondering whether it's because the busybox folder under /home/changd/anaconda3/bin is titled 'busybox-1.31.1' and therefore it was not found.

@odow
Copy link
Member

odow commented May 15, 2020

Your sysadmin can help you with this. It seems like it's a non-standard setup. They'll know how to modify your path to get curl and tar, so this isn't a Julia or Gurobi.jl issue.

@changd
Copy link
Author

changd commented Jun 12, 2020

Pkg.add("Gurobi") and using Gurobi are working now after some fixes. It appears the issue was cross contamination of the anaconda environment.

@changd changd closed this as completed Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants