fnemina / pyOSOAA

pyOSOAA is a python interface for the Ocean Successive Orders with Atmosphere - Advanced (OSOAA) radiative transfer.
GNU General Public License v3.0
20 stars 6 forks source link

can not run test with python3.7 on mac #48

Open binbinjiang1990 opened 1 year ago

binbinjiang1990 commented 1 year ago

import pyOSOAA pyOSOAA.test() Traceback (most recent call last): File "", line 1, in File "/Users/bjiang/Documents/pyOSOAA/pyOSOAA/osoaa.py", line 1386, in test s = OSOAA() File "/Users/bjiang/Documents/pyOSOAA/pyOSOAA/osoaa.py", line 1020, in init self.dirmie = DIRMIE(osoaaroot=self.root) File "/Users/bjiang/Documents/pyOSOAA/pyOSOAA/osoaa.py", line 198, in init self.hyd = os.path.join(osoaaroot, hid) File "/Users/bjiang/opt/anaconda3/envs/osoaa/lib/python3.7/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType

ghost commented 1 year ago

check your environment variable OSOAAROOT if exists

binbinjiang1990 commented 1 year ago

Dear Fenqiao,

Thank you so much.

i think this my OSOAAROOT folder " export OSOAA_ROOT="/Users/bjiang/Documents/pyOSOAA". " I am not sure if it is right or not.

Best

Binbin

On Thu, Mar 30, 2023 at 4:53 PM fengqiao @.***> wrote:

check your environment variable OSOAAROOT if exists

— Reply to this email directly, view it on GitHub https://github.com/fnemina/pyOSOAA/issues/48#issuecomment-1489936316, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATGNFSBBRX4J5JMED5GY2LTW6VCW3ANCNFSM6AAAAAAWM5HVRY . You are receiving this because you authored the thread.Message ID: @.***>

ghost commented 1 year ago

OSOAA_ROOT=/Users/bjiang/Documents/OSOAA not pyOSOAA

binbinjiang1990 commented 1 year ago

Dear Fengqiao,

Thank you for your reply.

is that means i should follow "OSOAA installation" step first in "pyOSOAA Documentation". But my system is mac, not ubuntu 18. is that works for me?

Best

Binbin

fnemina commented 1 year ago

Dear Binbinjian

As Fengqiao described you need to first follow the OSOAA install procedure before moving to using pyOSOAA.

A few pointers for installing it on mac:

  1. You can get the gfortran compiler from brew or from conda. If you use brew, a package manager similar to apt or dnf but for OSX, you can find the instruccions here: https://formulae.brew.sh/formula/gcc#default

  2. You need to set your export, the OSOAA_ROOT variable, in the config file of your shell. It should be .bashrc or .zshrc

After doing this two things the test should work, but feel free to ask me anytime.

Best Fran

binbinjiang1990 commented 1 year ago

Dear Fran,

Thanks a lot. I already tried "brew" instead of "apt" . also install "gfortran ksh93 git make" with brew one by one. But I tried to " make -f $OSOAA_ROOT/gen/Makefile_OSOAA.gfortran", but it failed. The details are below.

By the way "export OSOAA_ROOT="/Users/bjiang/Documents/OSOAA" it was already been changed .

Best

Binbin

(base) @.*** gen % make -f /Users/bjiang/Documents/OSOAA/gen/Makefile_OSOAA.gfortran

make: *** No rule to make target /src/OSOAA_MAIN.F', needed by /obj/OSOAA_MAIN.o'. Stop.

On Fri, Mar 31, 2023 at 4:46 AM Francisco Nemiña @.***> wrote:

Dear Binbinjian

As Fengqiao described you need to first follow the OSOAA install procedure before moving to using pyOSOAA.

A few pointers for installing it on mac:

1.

You can get the gfortran compiler from brew or from conda. If you use brew, a package manager similar to apt or dnf but for OSX, you can find the instruccions here: https://formulae.brew.sh/formula/gcc#default 2.

You need to set your export, the OSOAA_ROOT variable, in the config file of your shell. It should be .bashrc or .zshrc

After doing this two things the test should work, but feel free to ask me anytime.

Best Fran

— Reply to this email directly, view it on GitHub https://github.com/fnemina/pyOSOAA/issues/48#issuecomment-1490929456, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATGNFSA5MKBMFDXIFZTFMK3W6XWJJANCNFSM6AAAAAAWM5HVRY . You are receiving this because you authored the thread.Message ID: @.***>

fnemina commented 1 year ago

Hello, two questions:

  1. Did you add the OSOAA_ROOT variable to .bashrc or the .zshrc?
  2. Can you please give me the output of the echo $OSOAA_ROOT command.
binbinjiang1990 commented 1 year ago

Yes, I did.

my echo command is below, in figure.

Best, Binbin

(base) @.*** ~ % echo 'export OSOAA_ROOT="/Users/bjiang/Documents/OSOAA"' >> ~/.bashrc [image: Screen Shot 2023-04-06 at 10.36.48.png]

On Wed, Apr 5, 2023 at 11:43 PM Francisco Nemiña @.***> wrote:

Hello, two questions:

  1. Did you add the OSOAA_ROOT variable to .bashrc or the .zshrc?
  2. Can you please give me the output of the echo $OSOAA_ROOT command.

— Reply to this email directly, view it on GitHub https://github.com/fnemina/pyOSOAA/issues/48#issuecomment-1497705430, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATGNFSECU4GD4TRIE223JQTW7WHI5ANCNFSM6AAAAAAWM5HVRY . You are receiving this because you authored the thread.Message ID: @.***>

fnemina commented 1 year ago

Hello BinBin,

it seems that the image didn't to get to me. This is how the output should look like

Screenshot 2023-04-19 at 09 22 41

For what you have been telling me, I guess what is happening is you are using a different shell to the one where configured the OSOAA_ROOT variable. You can check your current shell using the command ps $$

Screenshot 2023-04-19 at 09 24 14

Best

binbinjiang1990 commented 1 year ago

Dear Fnemina/Pyosoaa,

Sorry for the late reply. Here is my result, below. thanks

Best

Binbin

[image: Screen Shot 2023-06-06 at 14.34.31.png]

On Wed, Apr 19, 2023 at 8:25 PM Francisco Nemiña @.***> wrote:

Hello BinBin,

it seems that the image didn't to get to me. This is how the output should look like

[image: Screenshot 2023-04-19 at 09 22 41] https://user-images.githubusercontent.com/2727433/233073619-eefccd7c-ab99-4d0b-9758-83b06bf00ab4.png

For what you have been telling me, I guess what is happening is you are using a different shell to the one where configured the OSOAA_ROOT variable. You can check your current shell using the command ps $$

[image: Screenshot 2023-04-19 at 09 24 14] https://user-images.githubusercontent.com/2727433/233073870-2be97111-882d-4862-9b95-b95c8114cbb0.png

Best

— Reply to this email directly, view it on GitHub https://github.com/fnemina/pyOSOAA/issues/48#issuecomment-1514643048, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATGNFSHJD2TLT7LL5NMDMPDXB7KSLANCNFSM6AAAAAAWM5HVRY . You are receiving this because you authored the thread.Message ID: @.***>