robintw / Py6S

A Python interface to the 6S Radiative Transfer Model
GNU Lesser General Public License v3.0
195 stars 108 forks source link

Latest version of Py6S throws error #56

Closed maximlamare closed 3 years ago

maximlamare commented 4 years ago

Hi, when following the instructions and installing Py6S with conda on a Mac:

conda create -n py6s-env -c conda-forge py6s

The test fails:

from Py6S import * SixS.test()

6S wrapper script by Robin Wilson
Using 6S located at /Users/maxim/opt/anaconda3/envs/py6s-env/bin/sixs
Running 6S using a set of test parameters
b'Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG\n'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/maxim/opt/anaconda3/envs/py6s-env/lib/python3.6/site-packages/Py6S/sixs.py", line 354, in test
    test.run()
  File "/Users/maxim/opt/anaconda3/envs/py6s-env/lib/python3.6/site-packages/Py6S/sixs.py", line 315, in run
    self.outputs = Outputs(outputs[0], outputs[1])
  File "/Users/maxim/opt/anaconda3/envs/py6s-env/lib/python3.6/site-packages/Py6S/outputs.py", line 64, in __init__
    raise OutputParsingError("6S returned an error (shown above) - check for invalid parameter inputs")
Py6S.sixs_exceptions.OutputParsingError: 6S returned an error (shown above) - check for invalid parameter inputs

I've tried with different versions of Py6S in conda-forge and different versions of Python, all yield the same error.

robintw commented 4 years ago

Thanks for reporting the issue. I'm aware of a problem with the conda builds for Mac, which causes this error - I need to fix Py6S to deal with the error properly. It's on my todo list, but life has been a bit chaotic recently with the pandemic and my son's nursery closing. I'll try and get to it ASAP.

In the meantime, you can try the following:

  1. Uninstall conda's version of sixs: conda uninstall sixs

  2. Download http://rtwilson.com/downloads/sixs_mac, rename it to sixsV1.1 and put it somewhere on your PATH (somewhere like /usr/local/bin or anywhere else that you manually add to your PATH)

  3. Try running the Py6S test again - it should pick up the new 6S executable, and hopefully that version will work on your system (it has come from my Mac, so should work).

Let me know how you get on

maximlamare commented 4 years ago

Thank you for the fix, I didn't want to put pressure on you in these hard times, I'm sorry! But now with the fix I can continue working from home using Py6S!

For others that might run into the same problem, I didn't manage to fix Py6S with conda as mentioned in the steps above. However, putting sixsV1.1 on the PATH then installing Py6S with pip works.