dstndstn/tractor

Issue installing in conda environment - astrometry.utils not found

Opened this issue · 3 comments

I am trying to install Tractor and astrometry.net in a conda environment using pip (from yaml file):

- pip:
    - git+https://github.com/dstndstn/astrometry.net.git@main
    - git+https://github.com/dstndstn/tractor.git@main

This worked before, and seems to complete successfully. However, I now get an error loading Tractor because the package "astrometry.utils" is not found, and I don't see the utils directory in the conda env .../site-packages/astrometry/ directory where it would normally live after a successful installation.

Thanks, Dustin. We were able to get a workaround installation running, by specifying a previous version of setuptools and earlier versions of tractor and astrometry.net. Not ideal, but it works for now. We thought this could potentially help debug the issue with pip installation. The details are below.

  1. We create a conda environment with setuptools<66.0.0 before PEP 440 version compliance was enforced.

The env.yaml file looks like this:

name: tractor
channels:
- conda-forge
- default
dependencies:
- astropy
- astropy-healpix
- fitsio
- gsl
- healpy
- ipykernel
- mpi4py
- netpbm
- numpy
- pandas
- pip <23.0
- pyopencl
- python >=3.10.0
- pyyaml
- requests
- seaborn
- setuptools < 66.0.0
- scikit-image
- scipy
- swig

  1. We store pip’s dependencies in a separate file requirements.txt (using previous version of tractor that we had working in December):

git+https://github.com/dstndstn/astrometry.net.git@0.92
git+https://github.com/dstndstn/tractor.git@cf8bac3

  1. We install with the following:

conda env create --name tractor_20230604 --file env.yaml
conda activate tractor_20230604
pip install -r requirements.txt

jhod0 commented

I am also running into this problem. It looks like the setup.py is not properly copying over sub-directories in the installation process.

On my local machine, I am able to get around this by using pip install --editable . in the cloned astrometry repo, which just points python to the current directory rather than copying the astrometry files so the right place. This is not ideal but might help other people