desihub/speclite

speclite v0.9 installation problems

Closed this issue · 4 comments

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.

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.

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

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.

A few data points:

  • I tried doing python setup.py install --prefix ... (to keep the install separate from anything else) from a git clone where I explicitly checked out tag v0.9.
  • The speclite/data (in the Python package) directory was not installed at all, so that's the big problem here.
  • The install was placed in python3.6/site-packages/packagename-0.9.dev528-py3.6.egg, so not only is the install process not picking up the name of the package, it is also getting the version wrong (version should be 0.9, since this is tag v0.9).
  • Although speclite/data is listed in the setup.py file (although not MANIFEST.in), it is possible that the mechanism that would normally install this package has "decayed away" in some sense.