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

Problem with contourpy package #6

Open
Marie59 opened this issue Apr 20, 2023 · 5 comments
Open

Problem with contourpy package #6

Marie59 opened this issue Apr 20, 2023 · 5 comments

Comments

@Marie59
Copy link
Contributor

Marie59 commented Apr 20, 2023

Hi @Alexander-Barth and @ctroupin,
It's me again, I got the tool running on a local galaxy and now I'm trying to run the entire notebook "90-full-analysis.ipynb" to be sure that everything is in order and to finalize the docker image (still some small modifications to be made after some testing).
At the step "2.1 Choice of bathymetry" when I try to run the figure just below I get the following error :

`PyError ($(Expr(:escape, :(ccall(#= /home/jovyan/.julia/packages/PyCall/twYvK/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'ImportError'>
ImportError("/opt/julia-1.8.3/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /opt/conda/lib/python3.10/site-packages/contourpy/_contourpy.cpython-310-x86_64-linux-gnu.so)")
 File "/opt/conda/lib/python3.10/site-packages/matplotlib/pyplot.py", line 2527, in contour
   __ret = gca().contour(
 File "/opt/conda/lib/python3.10/site-packages/matplotlib/__init__.py", line 1442, in inner
   return func(ax, *map(sanitize_sequence, args), **kwargs)
 File "/opt/conda/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 6451, in contour
   contours = mcontour.QuadContourSet(self, *args, **kwargs)
 File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 769, in __init__
   kwargs = self._process_args(*args, **kwargs)
 File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 1395, in _process_args
   import contourpy
 File "/opt/conda/lib/python3.10/site-packages/contourpy/__init__.py", line 7, in <module>
   from contourpy._contourpy import (


Stacktrace:
 [1] pyerr_check
   @ ~/.julia/packages/PyCall/twYvK/src/exception.jl:75 [inlined]
 [2] pyerr_check
   @ ~/.julia/packages/PyCall/twYvK/src/exception.jl:79 [inlined]
 [3] _handle_error(msg::String)
   @ PyCall ~/.julia/packages/PyCall/twYvK/src/exception.jl:96
 [4] macro expansion
   @ ~/.julia/packages/PyCall/twYvK/src/exception.jl:110 [inlined]
 [5] #107
   @ ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:43 [inlined]
 [6] disable_sigint
   @ ./c.jl:473 [inlined]
 [7] __pycall!
   @ ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:42 [inlined]
 [8] _pycall!(ret::PyCall.PyObject, o::PyCall.PyObject, args::Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, Matrix{Float64}, Vector{Float64}}, nargs::Int64, kw::PyCall.PyObject)
   @ PyCall ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:29
 [9] _pycall!(ret::PyCall.PyObject, o::PyCall.PyObject, args::Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, Matrix{Float64}, Vector{Float64}}, kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:colors, :linewidths), Tuple{String, Float64}}})
   @ PyCall ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:11
[10] pycall(::PyCall.PyObject, ::Type{PyCall.PyAny}, ::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:colors, :linewidths), Tuple{String, Float64}}})
   @ PyCall ~/.julia/packages/PyCall/twYvK/src/pyfncall.jl:83
[11] contour(::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, ::Vararg{Any}; kws::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:colors, :linewidths), Tuple{String, Float64}}})
   @ PyPlot ~/.julia/packages/PyPlot/H01LC/src/PyPlot.jl:194
[12] top-level scope
   @ In[17]:5`

Did you already have that ? Any idea of where it could be coming from ?

@Alexander-Barth
Copy link
Member

Alexander-Barth commented Apr 20, 2023

I confirm this issue. I think this is this issue:
JuliaLang/julia#34276

Simply removing the file /opt/julia-1.8.3/bin/../lib/julia/libstdc++.so.6 worked for me to force loading the system libstdc++.so (used by python and which is newer that the julia libstdc++.so). This will be the default for the upcoming version 1.9 of julia:

https://github.com/JuliaLang/julia/blob/master/HISTORY.md#external-dependencies

I will make a new docker image with the /opt/julia-1.8.3/bin/../lib/julia/libstdc++.so.6 removed.

To reproduce the issue quickly:

using PyPlot; contourf(randn(10,10))

@Alexander-Barth
Copy link
Member

Does it work for you now with abarth/divand-jupyterhub:2023-04-20T0902 ?

@Marie59
Copy link
Contributor Author

Marie59 commented Apr 20, 2023

I added a line removing /opt/julia-1.8.3/bin/../lib/julia/libstdc++.so.6 as you said in my local dockerfile of divand. It's working !! Thank you !
The only issue I had was in "3.1 World Ocean Database" with this linewod_all_data_filename = download("https://dox.ulg.ac.be/index.php/s/Px6r7MPlpXAePB2/download")
But I think the issue is just coming from the fact that download needs a 2nd argument with a name for the file (so I tried with a random name .nc) and it worked. The entire notebook seems to be running correctly !

@ctroupin
Copy link
Member

Hello Marie,
in fact the function download can work with only 1 argument, in that case the file that is downloaded is located in a tmp directory; and the output of download (here: "wod_all_data_filename") is the path of the file.

julia> filename = download("https://dox.ulg.ac.be/index.php/s/Px6r7MPlpXAePB2/download"); @show(filename);
filename = "/tmp/jl_iTkDKbOvWV"

but maybe on Galaxy, it is not possible to write files in /tmp/.

@Alexander-Barth
Copy link
Member

To debug this, one can use the julia function tempdir() (which is indeed /tmp per default). tempdir() should return be a writable directory. It could also be just a temporary network issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants