spacetelescope / drizzlepac

AstroDrizzle for HST images.
https://drizzlepac.readthedocs.io
BSD 3-Clause "New" or "Revised" License
50 stars 39 forks source link

drizzlepac, fitsblender, and cannot import name 'six' #1334

Closed AdamER123 closed 2 years ago

AdamER123 commented 2 years ago

First issue report I've tried on github, please tell me if I miss anything. This is for aligning some HST frames from MAST (link to exact frames). In the header it says the images aren't aligned and not sure of an easier way than using drizzlepac based on the documentation here.

I tried following directions to import drizzlepac on my Windows PC, but I couldn't get it working (PackageNotFoundError). I switched to a unix machine that I ssh into (no admin privilege but presumably easier with terminal) but got an error about importing six after updating everything (as requested). I first tried following the update instructions (and other parts of the docs there).

I went to google and saw that six is deprecated for astropy. I could maybe fix this manually by changing which versions of astropy et al I'm using with Anaconda, but I wanted to double check to see if this was reported, see if maybe I just setup Astroconda incorrectly, or something else I didn't notice.

Exact error I got while importing in Ipython on the unix machine:

<ipython-input-4-42555684ed11> in <module>()
----> 1 import drizzlepac

/opt/anaconda3/lib/python3.6/site-packages/drizzlepac/__init__.py in <module>()
     22 from .version import *
     23
---> 24 from . import ablot
     25 from . import adrizzle
     26 from . import astrodrizzle

/opt/anaconda3/lib/python3.6/site-packages/drizzlepac/ablot.py in <module>()
     15 import numpy as np
     16 from stsci.tools import fileutil, teal, logutil
---> 17 from . import outputimage
     18 from . import wcs_functions
     19 from . import processInput

/opt/anaconda3/lib/python3.6/site-packages/drizzlepac/outputimage.py in <module>()
     15 from . import version
     16
---> 17 from fitsblender import blendheaders
     18
     19 yes = True

/opt/anaconda3/lib/python3.6/site-packages/fitsblender/__init__.py in <module>()
     35 from .blender import fitsblender
     36
---> 37 from . import blendheaders
     38
     39 # These lines allow TEAL to print out the names of TEAL-enabled tasks

/opt/anaconda3/lib/python3.6/site-packages/fitsblender/blendheaders.py in <module>()
      9 import numpy as np
     10 from astropy.io import fits
---> 11 from astropy.extern import six
     12
     13 from stsci.tools import fileutil, textutil, parseinput

ImportError: cannot import name 'six'
stscijgbot-hstdp commented 2 years ago

This issue is tracked on JIRA as HLA-749.

stsci-hack commented 2 years ago

One workaround might be to use 'pip install six' when logged into the conda environment you are using. Alternatively, the instructions on the astroconda-releases page for the latest caldp release should allow you to install the package under Linux with minimal effort. It also looks as if you are installing the code under Python 3.6, which has been deprecated and is known to introduce various dependency problems with astropy and other packages. The caldp releases available on astroconda specify a complete set of specific packages and versions which have been tested to work as an complete environment.

As for installation under Windows, it is possible to install this package under Windows, but it is not a supported mode of installation yet. Eventually we may be able to provide instructions on how to install under Windows, but for now, we are not able to officially support Windows installations. Send a help question to 'help@stsci.edu' directly and I may be able to dig up my notes on what I personally did on my own time to get this package to run under Windows.

AdamER123 commented 2 years ago

Thank you for the help! I think I won't try the windows method yet just for sake of efficiency then. Just going to document how it went for me so far.

"One workaround might be to use 'pip install six' when logged into the conda environment you are using..."

I think my issue mostly turned out to be a permissions issue (trying to be careful on shared computers). I managed to work around it by essentially resetting things. I installed a fresh miniconda (v=4.11, py=3.7), getting six separately as you said, and directly editing any files with the astropy.extern.six issue. I know there's more recent versions, but for some reason I couldn't get that working just yet (may have to talk to IT Monday to get help reorganizing environments). This solved issues with drizzlepac(!). I still had issues with ccdproc but I think that more has to do with them/conda/pip and the default version with conda-forge for some reason being 1.x on my end (from what I can tell) as opposed to their v2 that they have up now.

stscijgbot-hstdp commented 1 year ago

Comment by Warren Hack on JIRA:

Fixed through the implementation of fitsblender PR #⁠35.