Closed ivvv closed 2 years ago
Thanks for the issue, will have a look.
@ivvv Do you have pyatomdb installed?
I have atomdb installed, and pyatomdb too. And did export ATOMDB=${HOME}/atomdb
import pyatomdb
pyatomdb.__version__
'0.10.8'
Tried to build and install astromodels from a cloned github repository, but this failed with a number of errors. One complication may be that there is no HEASOFT for ARM64, so I have it through homebrew and rosetta for x86_64, but I thought HEASOFT and Xspec are not needed by default, unless I want to use Xspec models.
Further update, I managed to install it with no errors and no problems to import atromodels and threeML, but I had to activate a virtualenv where I had python and xspec (and HEASOFT) compiled for x86_64. I am not sure if there will be a penalty on performance as running x86_64 on arm64 is through rosetta.
@ivvv ok, interesting. From what I know, there is no real penalty at all (some x86 instructions run faster on the arm than natively). Let me know if there are further problems.
Will do, for now it seems good.
Unfortunately I have to re-open this thicket as the problem happens in Linux too (Ubuntu).
Trying to import astromodels fails with the same error:
ModuleNotFoundError: No module named 'astromodels.functions.apec
Looking at the github and also in the astromodels distribution files, no sub-folder apec is to be found in functions folder.
I have ATOMDB installed and so it attempts to import from .apec but there is no such folder.
When I closed the ticket, I thought it worked, but actually ATOMDB wasn't properly set up on my M1 macBook and it was not trying to import APEC and VAPEC.
I tried to re-install astromodels after I installed pyatomdb, but no success.
Can you please have a look?
OK, solved it by editing __init__.py
with the following change:
if has_atomdb:
#from .functions import APEC, VAPEC
from .functions.functions_1D.apec import APEC, VAPEC
And then it worked as expected.
Oops. That was a change over. You can make a PR if you like or we will update it in the next release.
Fixed on the dev branch. Thanks!
I am on ARM64, conda python 3.10 and installed
astromodels
with pip with no errors, here is a check:When I try
import astromodels
in e.g. ipython session I see the following error:As a result, when I try to import
threeml
it fails with the same error because ofastromodels
.Can you please check?