prospector icon indicating copy to clipboard operation
prospector copied to clipboard

No module named 'prospect'

Open BarisBayraktar opened this issue 1 year ago • 6 comments

Hi, I was able to install the prospect but when I try to import it as per instructions on https://prospect.readthedocs.io/en/stable/installation.html I get this error:

In [1]: import prospect

ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 1 ----> 1 import prospect

ModuleNotFoundError: No module named 'prospect'

Note: I am using Arch Linux

BarisBayraktar avatar Mar 14 '25 17:03 BarisBayraktar

I now re-installed it with Miniconda but it didn't work either.

BarisBayraktar avatar Mar 14 '25 18:03 BarisBayraktar

Hi, this is not enough information for me to know what might be wrong. You might try posting the exact sequence of commands used to install and generate the error

bd-j avatar Mar 14 '25 20:03 bd-j

I used python -m pip install astro-prospector after installing Miniconda3 and then in python environment, I used import prospect and it gave me the error mentioned above.

BarisBayraktar avatar Mar 14 '25 20:03 BarisBayraktar

I now tried sedpy, emcee etc. other requirements and all gave the same error (just astropy worked).

BarisBayraktar avatar Mar 14 '25 22:03 BarisBayraktar

Turns out it was about AUR (Arch Linux package manager), I managed to install all but fsps.

import prospect now giving that error:

In [2]: import prospect
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[2], line 1
----> 1 import prospect

File ~/.local/lib/python3.13/site-packages/prospect/__init__.py:6
      3 except(ImportError):
      4     pass
----> 6 from . import models
      7 from . import fitting
      8 from . import io

File ~/.local/lib/python3.13/site-packages/prospect/models/__init__.py:8
      1 """This module includes objects that store parameter specfications and
      2 efficiently convert between parameter dictionaries and parameter vectors
      3 necessary for fitting algorithms.  There are submodules for parameter priors,
      4 common parameter transformations, and pre-defined sets of parameter
      5 specifications.
      6 """
----> 8 from .sedmodel import ProspectorParams, SedModel, SpecModel
      9 from .sedmodel import PolySpecModel, SplineSpecModel
     10 from .sedmodel import AGNSpecModel, LineSpecModel

File ~/.local/lib/python3.13/site-packages/prospect/models/sedmodel.py:15
     12 from scipy.interpolate import splrep, BSpline
     13 from scipy.stats import multivariate_normal as mvn
---> 15 from sedpy.observate import getSED
     17 from .parameters import ProspectorParams
     18 from .hyperparameters import ProspectorHyperParams

ModuleNotFoundError: No module named 'sedpy.observate'

BarisBayraktar avatar Mar 14 '25 23:03 BarisBayraktar

Turns out i installed sedpy but i should install astro-sedpy. I solved prospector not importing issue by installing correct sedpy library.

BarisBayraktar avatar Mar 15 '25 16:03 BarisBayraktar