desihub / speclite

Lightweight utilities for working with spectroscopic data
14 stars 19 forks source link

speclite v0.9 installation problems #54

Closed sbailey closed 4 years ago

sbailey commented 4 years ago

speclite v0.9 isn't on pypi yet so I'm trying to install with pip directly from GitHub. If I use either of these, it doesn't seem to include the filter responses:

pip install https://github.com/dkirkby/speclite/archive/v0.9.tar.gz
pip install git+https://github.com/dkirkby/speclite.git@v0.9#egg=speclite

e.g.

(desitest) ~ $ python -c "import speclite.filters; r = speclite.filters.load_filter('decam2014-r')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/sbailey/anaconda3/envs/desitest/lib/python3.8/site-packages/speclite/filters.py", line 1918, in load_filter
    raise ValueError("No such filter '{0}' in this group.".format(name))
ValueError: No such filter 'decam2014-r' in this group.

However, if I clone the repo and use python setup.py install it seems to work fine:

git clone https://github.com/dkirkby/speclite
cd speclite
python setup.py install
...
python -c "import speclite.filters; r = speclite.filters.load_filter('decam2014-r')"
[no error]

Ideal would be to deploy to pypi so that normal pip install speclite works. Otherwise it would be helpful to know a 1-liner for simple instructions about how to install speclite v0.9.

sbailey commented 4 years ago

Actually, it is worse than I originally reported: python setup.py install from a git clone also doesn't work (which at least makes sense compared to the other failures). The previous test that appeared to be working was because I was sitting in the speclite/ directory and it was finding the filters it needed starting from that local path.

@dkirkby @weaverba137 please help fix the speclite installation procedure. This is needed for testing the next DESI software release. Thanks.

weaverba137 commented 4 years ago

When you say you were in the speclite directory, was that the top-level git checkout directory or the Python package directory?

sbailey commented 4 years ago

I was in the in the top level git checkout (i.e. the "..." in the above represents the installation output messages, not any additional commands I issued after ccing into the top level git checkout).

FWIW, it works to use speclite without installing it, by adding the top level git clone directory to $PYTHONPATH. It is only the installation procedure that seems to be missing the necessary data files.

Also: I was testing this with python 3.8 in a conda environment on my laptop, starting with:

conda create --name desitest --yes python=3.8 \
    numpy scipy astropy pyyaml requests ipython h5py scikit-learn \
    matplotlib numba sqlalchemy line_profiler pytest pytz

conda activate desitest
conda install -c conda-forge fitsio
pip install healpy

[then various attempts to install speclite]

Thanks for checking on this.

weaverba137 commented 4 years ago

A few data points: