[Thread Prev][Thread Next][Index]

Re: [ferret_users] GO files don't work from any directory



Hi Iris,

I corrected the path and then run the file again with a:
./pyferret-activate.sh

You need to run "conda activate <PyFerretEnvName>" (substituting the appropriate value for  <PyFerretEnvDir>, so something file "conda activate FERRET" if you installed the PyFerret package in an environment called "FERRET").  The conda activate command does some other setup steps but then also sources the contents of that pyferret-activate.sh script.  If you had already run "conda activate <PyFerretEnvName>" before making changes, run "conda deactivate", then run the conda activate command again to make sure it reads the updated environment settings.

Note that running just "./pyferret-activate.sh" will have no effect as it creates a new shell to run those commands, and then that shell goes away after the command is done.  That is why with non-conda PyFerret you need to run ". ferret_paths.sh" for Bourne shells (there is a space after the dot) or "source ferret_paths.csh" for C shells - or bash also accepts "source ferret_paths.sh".  The dot command and the source command mean the same thing: "run the script in the current shell" - so the environment definitions are then defined in the current shell.

After doing that, you can just run "echo $FER_DIR" to see what its value is.  If PyFerret is running fine but you are not seeing the datasets you expect, see what directories are in the environment variable FER_DATA (so "echo $FER_DATA").  I guess I should have first checked that you did install the ferret_datasets package along with the pyferret package.  There is also the "Fenv" command to show you all the Ferret-related environment variables.
 
Is this enough to activate it? Because it still doesn’t work (also restarted the terminal). Probably then my path is still wrong.
The file starts with the:

export FER_DIR="$CONDA_PREFIX"

That matches what I have.  The "conda activate <PyFerretEnvName>" command assigns the appropriate value for CONDA_PREFIX, so it is important to do that command and not just a "source pyferret-activate.sh" or ". pyferret-activate.sh". 

Karl

--
Karl M. Smith, Ph.D.
JISAO Univ. Wash. and PMEL NOAA
"The contents of this message are mine personally and do
not necessarily reflect any position of the Government
or the National Oceanic and Atmospheric Administration."

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement