Error installing ImageView Library

I work in medical imaging and am therefore trying to install the ImageView Library, but I am getting an error when I build it, as follows (sorry this is a bit lengthy but I have no idea what is important and what is not). Does anyone know how to fix this issue? thanks


Error: Error building Cairo:
│ sudo: no tty present and no askpass program specified
│ ERROR: LoadError: failed process: Process(sudo apt-get install gettext, ProcessExited(1)) [1]
│ Stacktrace:
│ [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
│ [2] pipeline_error at ./process.jl:705 [inlined]
│ [3] run#505(::Bool, ::Function, ::Cmd) at ./process.jl:663
│ [4] run(::Cmd) at ./process.jl:661
│ [5] run(::BinDeps.SynchronousStepCollection) at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:521
│ [6] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/dependencies.jl:944
│ [7] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/dependencies.jl:910
│ [8] satisfy!(::BinDeps.LibraryGroup) at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/dependencies.jl:874
│ [9] top-level scope at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/dependencies.jl:977
│ [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
│ in expression starting at /home/pratiksamant/.julia/packages/Cairo/p68X8/deps/build.jl:176
│ Installing dependency gettext via sudo apt-get install gettext:
└ @ Pkg.Operations /buildworker/worker/package_linux32/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1096

I also have this error:

Error: Error building Gtk:
│ sudo: no tty present and no askpass program specified
│ ERROR: LoadError: failed process: Process(sudo apt-get install libgtk-3-dev, ProcessExited(1)) [1]
│ Stacktrace:
│ [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
│ [2] pipeline_error at ./process.jl:705 [inlined]
│ [3] #run#505(::Bool, ::Function, ::Cmd) at ./process.jl:663
│ [4] run(::Cmd) at ./process.jl:661
│ [5] run(::BinDeps.SynchronousStepCollection) at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:521
│ [6] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/dependencies.jl:944
│ [7] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/dependencies.jl:910
│ [8] satisfy!(::BinDeps.LibraryGroup) at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/dependencies.jl:874
│ [9] top-level scope at /home/pratiksamant/.julia/packages/BinDeps/ZEval/src/dependencies.jl:977
│ [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
│ in expression starting at /home/pratiksamant/.julia/packages/Gtk/mVhmL/deps/build.jl:63
│ Installing dependency libgtk-3-dev via sudo apt-get install libgtk-3-dev:
└ @ Pkg.Operations /buildworker/worker/package_linux32/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1096

What happens when you try to install something from the terminal, e.g. sudo apt-get install libgtk-3-dev?

Also, please quote your code: Please read: make it easier to help you

Oh, sorry, I have added a screenshot of my code. I have tried running that command from the terminal, it installed something (I assume libgtk-3-dev) but I still get the exact same error.

Hello @samantp at the moment I work with a company which is applying Machine Learning to mammography. Interesting stuff… but a Python shop!
May I ask what work you are doing in medical imaging?
Also are you running Julia in some sort of VM?

I think this is the clue - which is why I ask you about the setup you have. How are you logging in?
With Julia 1.0.3 on Ubuntu 18.04 I am able to add the ImageView package - actually it is still building.
This is on my own laptop though, no VM or Docker image

I am trying to use Machine learning in analysing MR linac images. I am running Julia 1.04 via Jupyter notebook in Ubuntu 18.04. I have tried building the package just by launching julia through my ubuntu terminal but I get the same error message unfortunately.

Plese try thse commands at the REPL
julia> run(date)

julia> run(sudo date)

Also in my ignoramce… I know what an MRI scanner is… and what a Linac is…
What the heck is an MR Linac?

Also at your terminal prompt just:
sudo date

You may be interested to know that I worked in conformational radiotherapy a looooooonnnnggg time ago.
Programming in Fortran on a Sun workstation with 2 Mbytes - yes Mbytes- of RAM.
A simple 2D program was difficult to run. I Was trying to use simulated annealing.

If you can use Julia 1.3 the installation mechanism is completely different and should not require sudo.

Just the sum of its components :slight_smile: it’s a Linac with an integrated MR scanner: MR-LINAC image-guided radiotherapy

Unfortunately both commands return errors:
julia> run(date)
ERROR: UndefVarError: date not defined
Stacktrace:
[1] top-level scope at none:0

julia> run(sudo date)
ERROR: syntax: missing comma or ) in argument list

Ooof, sounds rough! How the times have changed :slight_smile:

You need to use ` to create a runnable command:

julia> run(date)
ERROR: UndefVarError: date not defined
Stacktrace:
 [1] top-level scope at REPL[51]:1

julia> run(`date`)
Fr Jän 31 11:59:01 CET 2020
Process(`date`, ProcessExited(0))

I believe I have found a solution for this issue, the version of Julia I was using was 1.0.3, I have uninstalled this and instead started on 1.3.1 and ImageView works without issue. I think that ImageView is not compatible with older versions of Julia. Thanks to all responses who tried to help! I guess I should have mentioned the Julia version, apologies!

Glad it works now.

For most non-mac people ImageView works fine on Julia 1.0.x. As I said above (Error installing ImageView Library - #10 by tim.holy), prior to Julia 1.3 it does require sudo, and that seemed to be where you were having trouble.