photutils icon indicating copy to clipboard operation
photutils copied to clipboard

cannot import name 'circular_footprint' from 'photutils.utils

Open tahereparto opened this issue 1 year ago • 2 comments

Hello, I install photutils successfully, but I can't import circular_footprint from photutils.utils, and I get the error:

ImportError: cannot import name 'circular_footprint' from 'photutils.utils' (/usr/local/lib/python3.7/dist-packages/photutils/utils/init.py)

tahereparto avatar Aug 09 '22 19:08 tahereparto

The circular_footprint function was added in version 1.5.0. You'll need to upgrade your version.

larrybradley avatar Aug 10 '22 02:08 larrybradley

Thank you very much. So I guess I have a problem with installing photutils version 1.5 on my google colab. The new version requires python >= 3.8, so I install python 3.8 using the code below. I also change the sys.path, and I install photutils successfully using pip. The problem is that when I import photutils I get the following Error. I also tried to install photutils using conda, but the result is the same. I checked the python version is 3.8 and also the pip version. Is there any problem with the sys.path?

The error: `/usr/local/lib/python3.8/sitepackages/photutils/geometry/init.py in () 4 """ 5 ----> 6 from .circular_overlap import * # noqa 7 from .elliptical_overlap import * # noqa 8 from .rectangular_overlap import * # noqa

ModuleNotFoundError: No module named 'photutils.geometry.circular_overlap`

The way I install python 3.8 and photutils 1.5 on google colab: `!wget -O mini.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh

!chmod +x mini.sh

!bash ./mini.sh -b -f -p /usr/local

!conda install -q -y --prefix /usr/local jupyter

!python -m ipykernel install --name "py38" --user

import sys sys.path.append('/usr/local/lib/python3.8/site-packages/')

!pip install photutils==1.5 `

tahereparto avatar Aug 11 '22 09:08 tahereparto

This is the same issue as https://github.com/astropy/photutils/issues/1402. I don't have any suggestions on how to upgrade Python on Google colab.

larrybradley avatar Aug 22 '22 21:08 larrybradley