[ncl-install] Error when running NCL script: Syntax error in gsn_code.ncl and WRFUserARW.ncl

Marieanne Leong marieanneleong at gmail.com
Fri Sep 4 08:12:41 MDT 2020


Hi,


I had issues with anaconda/ncl installation - struggled to install it under
/opt directory and set permission for users to write to /opt/anaconda3
directory. So I’d like to share the solution here, which Andrei Kurbatov
has kindly helped me resolve.


This solution involves installing anaconda via the command-line, instead of
the graphical installer.


You may download the command-line version of the installers from here:
https://docs.anaconda.com/anaconda/install/mac-os/


Here are the steps:

   1. Make the anaconda installer executable for all users by typing

   chmod a+x /path/to/Anaconda3-2020.07-MacOSX-x86_64.sh
   <http://anaconda3-2020.07-macosx-x86_64.sh/>

   2. To install anaconda, type

   sudo bash /path/to/Anaconda3-2020.07-MacOSX-x86_64.sh
   <http://anaconda3-2020.07-macosx-x86_64.sh/>

   At this point, you may check the output from
   ls /opt
   and make sure that anaconda3 is installed in /opt directory.

   3. Make the /opt/anaconda3 directory writable for your account, type

   sudo chgrp -R staff /opt/anaconda3

   4. Then, set ‘Read and Write’ permission for the root and staff group
   only by typing

   sudo chmod 770 -R /opt/anaconda3

   In case you are having issues with this, i.e. getting an error message
   ‘chmod: -R: No such file or directory’, then try to do it manually from
   Finder. You may refer here (
   https://eclecticlight.co/keychains-permissions/) for more information
   (see labels 1, 2 and 3 in red on the last figure in the website)

   In the Finder, select ‘Go’, then ‘Go to Folder’.
   Type /opt, then hit Enter.
   Right click /anaconda3 folder > Get Info.
   At the very bottom, click on the padlock and key in your password.
   Then, at the Privilege, make them have the following setting:
   system : Read and Write
   staff : Read and Write
   everyone: Read only

   5. Delete* the file ~/.bash_profile, and then create an empty one. Type

   rm ~/.bash_profile
   touch ~/.bash_profile

   * Note: If you have other settings in your ~/.bash_profile, DO NOT
   delete your ~/.bash_profile. Just open ~/.bash_profile and remove the
   portion about anaconda setting that begins and ends with # >>> condo
   initialize >>>.

   6. Recreate the anaconda setting in ~/.bash_profile by typing

   source /opt/anaconda3/bin/activate
   conda init

   7. Next, logout from the Mac OS or restart the computer.

   8. Check existing environments in anaconda, type

   conda env list

   You should only have
   base   * /opt/anaconda3

   9. Create ncl environment and install ncl, type

   conda create -n ncl -c conda-forge ncl

   Type ‘y’ to install all the other libraries associated with the
   installation

   In case you are faced with writing permissions at this stage, check that
   you have the Read & Write permission as specified in #4.

   10. Once it is installed, type

   conda activate ncl

   11. Under the prompt, type

   ncl

   to check that it is working.

In case you encounter errors when running an ncl script on the terminal
(e.g. ‘ncl script.ncl’),  check your script and ensure that you don’t load
any ncl libraries in the script. In NCL Version 6.2.0 and above, these
libraries are automatically loaded so there is no need to include them in
the script.

Hope this helps others who are experiencing the same issue.

Best,
Mae

On Sun, Aug 23, 2020 at 9:26 AM Marieanne Leong <marieanneleong at gmail.com>
wrote:

> Hi,
>
> I am having a problem with running an NCL script. When I run the script, I
> get these error messages (attached).
>
> Here are the other info that you may need.
> 1. conda list -n ncl_stable : output as attached
> 2. conda --version : conda 4.8.3
> 3. which ncl :
> /Users/marieanneleong/opt/miniconda3/envs/ncl_stable/bin/ncl
> 4. ncl -V : 6.6.2
> 5. env | grep NCARG : *NCARG*
> _ROOT=/Users/marieanneleong/opt/miniconda3/envs/ncl_stable
>
> I hope these details help and I look forward to your solution as soon as
> possible.
>
> Many thanks,
> Mae
>
>
> --
> Regards,
> Marieanne Leong
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-install/attachments/20200904/17367eaa/attachment.html>


More information about the ncl-install mailing list