Cannot find 'sas' module in sasmodels package
Hello everyone, I am trying to run the scripting tutorial <https://www.sasview.org/docs/user/qtgui/Perspectives/Fitting/scripting.html>, and I am unable to run the code because I can't import the 'sas' package. When I run the import statements at the top of the tutorial, i.e. import sys
from bumps.names import * from sasmodels.core import load_model from sasmodels.bumps_model import Model, Experiment from sasmodels.data import load_data, set_beam_stop, set_top
I get
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[9], line 4 2 from bumps.names import * 3 from sasmodels.core import load_model ----> 4 from sasmodels.bumps_model import Model, Experiment 5 from sasmodels.data import load_data, set_beam_stop, set_top
File ~/micromamba/envs/smi_py311/lib/python3.11/site-packages/sasmodels/bumps_model.py:20 16 __all__ = ["Model", "Experiment", "BumpsParameter"] 18 import numpy as np # type: ignore ---> 20 from .data import plot_theory 21 from .direct_model import DataMixin 23 # pylint: disable=unused-import
File ~/micromamba/envs/smi_py311/lib/python3.11/site-packages/sasmodels/data.py:39 37 import numpy as np # type: ignore 38 from numpy import sqrt, sin, cos, pi ---> 39 import sas 40 # pylint: disable=unused-import 41 try:
ModuleNotFoundError: No module named 'sas'
I apparently have sasmodels installed, since I can successfully import load_model from sasmodels.core. However, it seems I am missing the sas package. I have searched online and wasn't able to find any such package. I ran a simple pip install sas, and indeed, something downloaded, but it didn't resolve the issue. Any insights on the issue would be most appreciated. Best, Ian Billinge -- Ian Billinge *he/him/his* Ph.D Student, Yip Lab Dept. of Earth & Environmental Engineering Fu Foundation School of Engineering Columbia University in the City of New York
sas is the main package of sasview. I think that line should not be there. In latest version of sasmodels/data.py it isn't there: import numpy as np # type: ignore from numpy import sqrt, sin, cos, pi # pylint: disable=unused-import try: from typing import Union, Dict, List, Optional, Tuple, Callable Data = Union["Data1D", "Data2D", "SesansData"] Try cloning the latest sasmodels (and sasdata)? ________________________________ From: users <users-bounces@lists.sasview.org> on behalf of Ian Billinge via users <users@lists.sasview.org> Sent: 03 June 2024 15:02 To: users@lists.sasview.org <users@lists.sasview.org> Subject: [SasView Users] Cannot find 'sas' module in sasmodels package Hello everyone, I am trying to run the scripting tutorial<https://www.sasview.org/docs/user/qtgui/Perspectives/Fitting/scripting.html>, and I am unable to run the code because I can't import the 'sas' package. When I run the import statements at the top of the tutorial, i.e. import sys from bumps.names import * from sasmodels.core import load_model from sasmodels.bumps_model import Model, Experiment from sasmodels.data import load_data, set_beam_stop, set_top I get --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[9], line 4 2 from bumps.names import * 3 from sasmodels.core import load_model ----> 4 from sasmodels.bumps_model import Model, Experiment 5 from sasmodels.data import load_data, set_beam_stop, set_top File ~/micromamba/envs/smi_py311/lib/python3.11/site-packages/sasmodels/bumps_model.py:20 16 __all__ = ["Model", "Experiment", "BumpsParameter"] 18 import numpy as np # type: ignore ---> 20 from .data import plot_theory 21 from .direct_model import DataMixin 23 # pylint: disable=unused-import File ~/micromamba/envs/smi_py311/lib/python3.11/site-packages/sasmodels/data.py:39 37 import numpy as np # type: ignore 38 from numpy import sqrt, sin, cos, pi ---> 39 import sas 40 # pylint: disable=unused-import 41 try: ModuleNotFoundError: No module named 'sas' I apparently have sasmodels installed, since I can successfully import load_model from sasmodels.core. However, it seems I am missing the sas package. I have searched online and wasn't able to find any such package. I ran a simple pip install sas, and indeed, something downloaded, but it didn't resolve the issue. Any insights on the issue would be most appreciated. Best, Ian Billinge -- Ian Billinge he/him/his Ph.D Student, Yip Lab Dept. of Earth & Environmental Engineering Fu Foundation School of Engineering Columbia University in the City of New York
Hi Lucas, Thank you, your advice worked perfectly! Ian On Mon, Jun 3, 2024 at 10:12 AM Lucas Wilkins - STFC UKRI < lucas.wilkins@stfc.ac.uk> wrote:
sas is the main package of sasview. I think that line should not be there.
In latest version of sasmodels/data.py it isn't there:
import numpy as np # type: ignore from numpy import sqrt, sin, cos, pi
# pylint: disable=unused-import try: from typing import Union, Dict, List, Optional, Tuple, Callable Data = Union["Data1D", "Data2D", "SesansData"]
Try cloning the latest sasmodels (and sasdata)?
------------------------------ *From:* users <users-bounces@lists.sasview.org> on behalf of Ian Billinge via users <users@lists.sasview.org> *Sent:* 03 June 2024 15:02 *To:* users@lists.sasview.org <users@lists.sasview.org> *Subject:* [SasView Users] Cannot find 'sas' module in sasmodels package
Hello everyone,
I am trying to run the scripting tutorial <https://www.sasview.org/docs/user/qtgui/Perspectives/Fitting/scripting.html>, and I am unable to run the code because I can't import the 'sas' package.
When I run the import statements at the top of the tutorial, i.e.
import sys from bumps.names import * from sasmodels.core import load_model from sasmodels.bumps_model import Model, Experiment from sasmodels.data import load_data, set_beam_stop, set_top
I get
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[9], line 4 2 from bumps.names import * 3 from sasmodels.core import load_model ----> 4 from sasmodels.bumps_model import Model, Experiment 5 from sasmodels.data import load_data, set_beam_stop, set_top
File ~/micromamba/envs/smi_py311/lib/python3.11/site-packages/sasmodels/bumps_model.py:20 16 __all__ = ["Model", "Experiment", "BumpsParameter"] 18 import numpy as np # type: ignore ---> 20 from .data import plot_theory 21 from .direct_model import DataMixin 23 # pylint: disable=unused-import
File ~/micromamba/envs/smi_py311/lib/python3.11/site-packages/sasmodels/data.py:39 37 import numpy as np # type: ignore 38 from numpy import sqrt, sin, cos, pi ---> 39 import sas 40 # pylint: disable=unused-import 41 try:
ModuleNotFoundError: No module named 'sas'
I apparently have sasmodels installed, since I can successfully import load_model from sasmodels.core. However, it seems I am missing the sas package. I have searched online and wasn't able to find any such package. I ran a simple pip install sas, and indeed, something downloaded, but it didn't resolve the issue.
Any insights on the issue would be most appreciated.
Best,
Ian Billinge -- Ian Billinge *he/him/his* Ph.D Student, Yip Lab Dept. of Earth & Environmental Engineering Fu Foundation School of Engineering Columbia University in the City of New York
-- Ian Billinge *he/him/his* Ph.D Student, Yip Lab Dept. of Earth & Environmental Engineering Fu Foundation School of Engineering Columbia University in the City of New York
participants (2)
-
Ian Billinge via users -
Lucas Wilkins - STFC UKRI via users