Page 5 of 5

Re: SeaDAS 8 install_OCSSW problem with python requests

Posted: Thu Nov 11, 2021 7:19 am America/New_York
by gnwiii
OB SeaDAS - xuanyang02 wrote: Wed Nov 10, 2021 10:43 am America/New_York Can you try

Code: Select all

/Users/bcollist/opt/anaconda3/bin/python3 -m pip install requests
You need Python requests package v2.18.0 or later
With anaconda python you should use:
https://anaconda.org/anaconda/requests
(currently shows version 2.23 for macOS).

Note that using anaconda python by setting only the PATH variable is not reliable, as some instances of anaconda python activate may set additional environment variables. Use the documented patterns:

Code: Select all

source <path to conda>/bin/activate
conda init <name_of_target_shell_family (sh or zsh)>
https://conda.io/projects/conda/en/late ... nvironment states:
You may receive a warning message if you have not activated your environment:

Code: Select all

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation.
If you receive this warning, you need to activate your environment.
I have never seen this message, but I have seen "fail to load" problems when a user did not activate the anaconda environment (on macOS users had fewer problems with macports' python -- it is all to easy to lose track of anaconda activations).

Re: SeaDAS 8 install_OCSSW problem with python requests

Posted: Tue May 24, 2022 3:44 am America/New_York
by hedmondjohn
To make it short, it means that you lacked some "dependencies" for the libraries you wanted to use. This is a common problem when installing python packages, mainly in windows. Before trying to use any kind of library, first it is suggested to look up whether it needs another library in python "family".

The solution is to provide the python interpreter with the path-to-your-module/library. The simplest solution is to append that python path to your sys.path list. In your notebook, first try:

import sys
sys.path.append('my/path/to/module/folder')

This isn't a permanent change in sys.path, because when you log out, your environment is reset, so any variables you may have set are lost.

The better (and more permanent) way to solve this is to set your PYTHONPATH, which provides the interpreter with additional directories look in for python packages/modules.

from BASH type: export PYTHONPATH=/path/to/new/folder:/another/path/...../

#each path must be separated by a colon

http://net-informations.com/python/intro/path.htm

Re: SeaDAS 8 install_OCSSW problem with python requests

Posted: Thu Jun 02, 2022 12:44 pm America/New_York
by gnwiii
hedmondjohn wrote: Tue May 24, 2022 3:44 am America/New_York [...] The simplest solution is to append that python path to your sys.path list. In your notebook, first try:

Code: Select all

import sys
sys.path.append('my/path/to/module/folder')
The popularity of Python means there are more and more clashes between very different libraires with the same name as well as multiple modules with differing versions. Combined with the sharing of python scripts across platforms, it is important that scripts a) document which module is required, and b) use `sys.path` to ensure that the desired module is used. The most common name clash I see is ESA SNAP snappy versus Google's snappy compression library. I find it helpful to use:

Code: Select all

# comment regarding the source, version, and purpose of the module
import sys
sys.path.insert(0, "<path_for_desired_module>")

Re: SeaDAS 8 install_OCSSW problem with python requests

Posted: Tue Sep 27, 2022 5:21 pm America/New_York
by jkravitz
Hi all,

I have tried many of the suggestions within this thread, however, I am still getting:

ModuleNotFoundError: No module named 'requests'

when trying to install the hico processor from the GUI. I am running macOS Big Sur V11.7

Any help would be appreciated. I can provide any info as necessary.
Thanks, Jeremy

Re: SeaDAS 8 install_OCSSW problem with python requests

Posted: Wed Sep 28, 2022 7:57 am America/New_York
by gnwiii
jkravitz wrote: Tue Sep 27, 2022 5:21 pm America/New_York I have tried many of the suggestions within this thread, however, I am still getting:

ModuleNotFoundError: No module named 'requests'

when trying to install the hico processor from the GUI. I am running macOS Big Sur V11.7
You should provide enough detail so others can reproduce the problem. I assume you are on Intel hardware. Are you using a third party python? How did you install the "requests" package? Please attach the file generated by "SeaDAS/System Info".

Note that you may need to run SeaDAS from a terminal to ensure the appropriate Python interpreter is used (e.g., for Anaconda Python you need a terminal with an Anaconda environment active).

Re: SeaDAS 8 install_OCSSW problem with python requests

Posted: Wed Sep 28, 2022 8:01 am America/New_York
by OB.DAAC - SeanBailey
In a terminal, using the system installed pip3, run:

/usr/bin/pip3 install requests