[ncl-talk] NCAR graphic library in Julia language?

Gus Correa gus at ldeo.columbia.edu
Fri Sep 24 15:16:51 MDT 2021


Hi Francesco

It seems to require Python < 3.9, which is what you have,
if I understand correctly the cryptic syntax of the error message.

You can try this.
Not guaranteed, but may work.

Create a separate environment with Python <3.9 (still in this conda
installation).

1) Make an yml text file like this
myenv.yml:

name: myenv
channels:
  - defaults
  - conda-forge
dependencies:
  - python=3.8 (or 3.6, or whatever works with pyngl)
  - another_package (list, one per line, using the leading "- ", all other
packages you may want or need)
  ...
  - pyngl

2) Then do:

conda env create --file=/path/to/myenv.yml

If all goes well, it will create a separate "myenv" environment
with Python 3.8 (or 3.6, or whatever), and pyngl.
Your conda baseline environment will still have Python 3.9.

3) Then activate the environment with:

conda activate myenv

4) To get out of this environment and return to the conda baseline do:

conda deactivate

**

It is a good idea to have different environments for different groups of
packages,
instead of dumping them all in the baseline conda environment, to avoid
this type of issue.

And welcome to the Python package version compatibility Hell!  :)
"Lasciate ogni speranza voi ch'entrate."
Imagine what Dante would say if he had to use Python ...

I hope this helps,
Gus Correa

On Fri, Sep 24, 2021 at 10:56 AM Dave Allured - NOAA Affiliate via ncl-talk
<ncl-talk at mailman.ucar.edu> wrote:

> Francesco, I am not familiar with PyNGL versions.  I hope someone from
> official PyNGL support can advise you about this.
>
>
> On Fri, Sep 24, 2021 at 7:04 AM Francesco Trotta <
> francesco.trotta4 at unibo.it> wrote:
>
>> Dear Dave
>> I'm try to install pyNGL library on my Debian 10 with conda:
>>
>> conda install -c conda-forge pyngl
>>
>>
>> But I get this error:
>>
>> """
>> This can take several minutes.  Press CTRL-C to abort.
>> failed
>>
>>
>> UnsatisfiableError: The following specifications were found
>> to be incompatible with the existing python installation in your
>> environment:
>>
>> Specifications:
>>
>>   - pyngl ->
>> python[version='2.7.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
>>
>> Your python: python=3.9
>>
>> If python is on the left-most side of the chain, that's the version
>> you've asked for.
>> When python appears to the right, that indicates that the thing on the
>> left is somehow
>> not available for the python version you are constrained to. Note that
>> conda will not
>> change your python version to a different minor version unless you
>> explicitly specify
>> that.
>>
>> The following specifications were found to be incompatible with your
>> system:
>>
>>   - feature:/linux-64::__glibc==2.28=0
>>   - pyngl -> libgcc-ng[version='>=7.3.0'] -> __glibc[version='>=2.17']
>>   - python=3.9 -> libgcc-ng[version='>=9.3.0'] ->
>> __glibc[version='>=2.17']
>>
>> Your installed version is: 2.28
>> """
>>
>>
>> Do you know how can I solve this problem?
>> I've installed python 3.9.5 on my machine. Is pyNgl supported for this
>> version?
>>
>> Best
>> Francesco
>> ------------------------------
>> *Da:* Dave Allured - NOAA Affiliate <dave.allured at noaa.gov>
>> *Inviato:* giovedì 30 gennaio 2020 21:27
>> *A:* Francesco Trotta <francesco.trotta4 at unibo.it>
>> *Cc:* ncl-talk at ucar.edu <ncl-talk at ucar.edu>
>> *Oggetto:* Re: [ncl-talk] NCAR graphic library in Julia language?
>>
>> Franz,
>>
>> Originally you asked about calling NCAR Graphics.  NCL is a different
>> system that uses NCAR Graphics internally.  The only way to call NCL right
>> now is through a shell function like "run" which you said you are using.
>> You might be able to improve efficiency by using environment variables to
>> pass data.
>>
>> It would be good to have a direct interface to call NCL from other
>> languages, so that you can efficiently send and receive data.  Currently
>> there is no such NCL interface for any language.  However, an NCL main
>> program can call C and fortran routines by using a wrapper facility.  This
>> is not of much help for calling NCL from Julia.
>>
>> http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclExtend.shtml
>>
>>
>> On Thu, Jan 30, 2020 at 3:40 AM Francesco Trotta <
>> francesco.trotta4 at unibo.it> wrote:
>>
>> Dear Dave,
>>    thanks for the informations!
>>    Up to now in my julia program for some tasks (like represent vector
>> fields, ...) I'm calling ncl scripts from julia with the 'run' function
>> (command for Running External Programs similar to NCL's systemfunc())
>>
>>    I still have to try to import the PyNGL library but I will try it!
>>
>>    I know that in julia you can import other library build in other
>> language
>>    (for example my colleague use the python visualization PyPlot and
>> Seaborn library)
>>
>>    I'm not expert but perhaps you need a wrapper to use an external
>> library ...
>>
>> thanks
>>
>> Francesco
>>
>> ------------------------------
>> *Inviato:* mercoledì 29 gennaio 2020 19:46
>> *A:* Francesco Trotta <francesco.trotta4 at unibo.it>
>>
>> Oops.  I meant to say, "This would also depend on whether the *NCAR
>> Graphics* runtime system is compatible with the Julia runtime system."
>>
>> Also you might consider calling *PyNGL*, the NCAR Graphics Python
>> interface, directly from Julia.  One again, there would be runtime
>> compatibility concerns.  These may be uncharted waters.
>>
>>
>> On Wed, Jan 29, 2020 at 11:37 AM Dave Allured - NOAA Affiliate <
>> dave.allured at noaa.gov> wrote:
>>
>> Ah.  Here we go.  The Julia home page, https://julialang.org, says "...
>> you can easily use libraries from Python, R, C/Fortran, C++, and Java."
>>
>> So theoretically you should be able to use either the C or Fortran
>> interface to NCAR Graphics, or even mix them.  This would also depend on
>> whether the NCL runtime system is compatible with the Julia runtime
>> system.  This would be worth testing.  If you try anything like this, let
>> us know what happens.  Thanks.
>>
>>
>> On Tue, Jan 28, 2020 at 10:53 AM Dave Allured - NOAA Affiliate <
>> dave.allured at noaa.gov> wrote:
>>
>> Franz, NCAR Graphics has C and fortran interfaces.  But I do not know
>> anything about Julia.  Are any of these options possible?
>>
>> * Julia calls C.
>> * Julia calls fortran.
>> * Julia calls a command shell, like NCL's systemfunc().
>>
>>
>> On Tue, Jan 28, 2020 at 6:46 AM Dennis Shea via ncl-talk <
>> ncl-talk at ucar.edu> wrote:
>>
>> Not that I know.
>>
>>
>> On Jan 28, 2020, at 4:12 AM, Francesco Trotta via ncl-talk <
>> ncl-talk at ucar.edu> wrote:
>> 
>>
>> Dear NCL-users
>>    I'm working with a code written in Julia program language
>>    Is there a way to import and use the NCAR graphic library in Julia
>> language?
>>
>> Best
>> Franz
>>
>> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210924/99e05a50/attachment.html>


More information about the ncl-talk mailing list