hzovaro / spaxelsleuth

A package for analysing data from large integral field unit surveys such as the SAMI and Hector Galaxy Surveys.
MIT License
1 stars 1 forks source link

pip install incorrect file locations #20

Closed sarahsweet closed 9 months ago

sarahsweet commented 1 year ago
  1. default config file is expected in ~/opt/miniconda3/lib/python3.11/site-packages/ but installed in ~/spaxelsleuth/spaxelsleuth/.
  2. from spaxelsleuth.loaddata.sami import make_sami_metadata_df returns ModuleNotFoundError:no module named 'spaxelsleuth.loaddata'

Both symptoms of incorrect setup for pip install?

hzovaro commented 11 months ago

Hi Sarah - thanks for bringing this up. I'm having difficulty reproducing this bug, but I've attempted to fix it by using pkgutils rather than the __file__ variable as it apparently takes on inconsistent values depending on how the package is installed. Could you try cloning into the installation-issues branch, installing using pip install . and running the following?

from spaxelsleuth import load_user_config
hzovaro commented 11 months ago

I found the underlying cause of the error, which was that submodules weren't being loaded in correctly in setup.py. I made a new branch called 20-pip-install-incorrect-file-locations for testing this - please try installing using pip install ., changing directories, and then importing one of the submodules, e.g.

import spaxelsleuth.loaddata
hzovaro commented 9 months ago

Closing for now as I was able to install spaxelsleuth on Gabby's machine during the Hector busy week.