When I try to import pyfits I get the following message
/home/elihu/anaconda3/lib/python3.7/site-packages/pyfits/__init__.py:22: PyFITSDeprecationWarning: PyFITS is deprecated, please use astropy.io.fits PyFITSDeprecationWarning) # noqa
Does anybody know how to fix this? I have Ubuntu 20.04.1 LTS focal and Python 3.7.6. Thanks!
Since it looks like you're using Anaconda, you can run
conda install astropy
. The original pyfits package was merged intoastropy.io.fits
so if you have existing code that usespyfits
you can replace the import statement withwithout changing much else. Note however that there may be additional deprecated or changed interfaces. PyFITS has not been updated as a separate package in over 5 years.