Error when using pip install for fitsio on Windows
I attempted to use pip install for fitsio on a Windows 10, 64-bit machine today. Here are the errors I encountered:
PS C:\Users\Ed> pip install fitsio Collecting fitsio Using cached fitsio-1.2.3.tar.gz (4.5 MB) Preparing metadata (setup.py) ... done Requirement already satisfied: numpy in c:\users\ed\appdata\local\programs\python\python311\lib\site-packages (from fitsio) (1.23.5) Building wheels for collected packages: fitsio Building wheel for fitsio (setup.py) ... error error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [112 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-311 creating build\lib.win-amd64-cpython-311\fitsio copying fitsio\fitslib.py -> build\lib.win-amd64-cpython-311\fitsio copying fitsio\fits_exceptions.py -> build\lib.win-amd64-cpython-311\fitsio copying fitsio\header.py -> build\lib.win-amd64-cpython-311\fitsio copying fitsio\util.py -> build\lib.win-amd64-cpython-311\fitsio copying fitsio_init_.py -> build\lib.win-amd64-cpython-311\fitsio creating build\lib.win-amd64-cpython-311\fitsio\hdu copying fitsio\hdu\base.py -> build\lib.win-amd64-cpython-311\fitsio\hdu copying fitsio\hdu\image.py -> build\lib.win-amd64-cpython-311\fitsio\hdu copying fitsio\hdu\table.py -> build\lib.win-amd64-cpython-311\fitsio\hdu copying fitsio\hdu_init_.py -> build\lib.win-amd64-cpython-311\fitsio\hdu creating build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\checks.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\makedata.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\test_empty_slice.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\test_header.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\test_header_junk.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\test_image.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\test_image_compression.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\test_lib.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\test_table.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests\test_warnings.py -> build\lib.win-amd64-cpython-311\fitsio\tests copying fitsio\tests_init_.py -> build\lib.win-amd64-cpython-311\fitsio\tests running egg_info writing fitsio.egg-info\PKG-INFO writing dependency_links to fitsio.egg-info\dependency_links.txt writing requirements to fitsio.egg-info\requires.txt writing top-level names to fitsio.egg-info\top_level.txt reading manifest file 'fitsio.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE.txt' writing manifest file 'fitsio.egg-info\SOURCES.txt' C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\build_py.py:202: SetuptoolsDeprecationWarning: Installing 'fitsio.test_images' as data is deprecated, please list it in
packages. !!############################ # Package would be ignored # ############################ Python recognizes 'fitsio.test_images' as an importable package, but it is not listed in the `packages` configuration of setuptools. 'fitsio.test_images' has been automatically added to the distribution only because it may contain data files, but this behavior is likely to change in future versions of setuptools (and therefore is considered deprecated). Please make sure that 'fitsio.test_images' is included as a package by using the `packages` configuration field or the proper discovery methods (for example by using `find_namespace_packages(...)`/`find_namespace:` instead of `find_packages(...)`/`find:`). You can read more about "package discovery" and "data files" on setuptools documentation page. !! check.warn(importable) copying fitsio\fitsio_pywrap.c -> build\lib.win-amd64-cpython-311\fitsio creating build\lib.win-amd64-cpython-311\fitsio\test_images copying fitsio\test_images\test_gzip_compressed_image.fits.fz -> build\lib.win-amd64-cpython-311\fitsio\test_images running build_ext Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "C:\Users\Ed\AppData\Local\Temp\pip-install-_1paepno\fitsio_6bc0109645be41ea958f0e008df93070\setup.py", line 319, in <module> setup( File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\__init__.py", line 87, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands dist.run_commands() File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands self.run_command(cmd) File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py", line 1217, in run_command super().run_command(command) File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command cmd_obj.run() File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\wheel\bdist_wheel.py", line 368, in run self.run_command("build") File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command self.distribution.run_command(command) File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py", line 1217, in run_command super().run_command(command) File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command cmd_obj.run() File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run self.run_command(cmd_name) File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command self.distribution.run_command(command) File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py", line 1217, in run_command super().run_command(command) File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command cmd_obj.run() File "C:\Users\Ed\AppData\Local\Temp\pip-install-_1paepno\fitsio_6bc0109645be41ea958f0e008df93070\setup.py", line 106, in run build_ext.run(self) File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\build_ext.py", line 84, in run _build_ext.run(self) File "C:\Users\Ed\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run self.build_extensions() File "C:\Users\Ed\AppData\Local\Temp\pip-install-_1paepno\fitsio_6bc0109645be41ea958f0e008df93070\setup.py", line 118, in build_extensions CCold = self.compiler.compiler ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'MSVCCompiler' object has no attribute 'compiler'. Did you mean: 'compile'? [end of output]note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for fitsio Running setup.py clean for fitsio Failed to build fitsio ERROR: Could not build wheels for fitsio, which is required to install pyproject.toml-based projects PS C:\Users\Ed>
I made a new attempt in the Anaconda environment. But it still failed. Below is the job log:
(base) C:\Users\Ed>conda activate redrock_env
(redrock_env) C:\Users\Ed>cd C:\Users\Ed\Documents\Ed\Ed@_Astronomy_Research\DESI\DESI\File_Analysis_Software\Visualization_Software\redrock
(redrock_env) C:\Users\Ed\Documents\Ed\Ed@_Astronomy_Research\DESI\DESI\File_Analysis_Software\Visualization_Software\redrock>pip install -r requirem ents.txt Collecting desispec (from -r requirements.txt (line 11)) Cloning https://github.com/desihub/desispec.git (to revision 0.51.13) to c:\users\ed\appdata\local\temp\pip-install-yyenx7r1\desispec_9ca2bbaad8a842 fd90eaf8dad3c479b0 Running command git clone --filter=blob:none --quiet https://github.com/desihub/desispec.git 'C:\Users\Ed\AppData\Local\Temp\pip-install-yyenx7r1\de sispec_9ca2bbaad8a842fd90eaf8dad3c479b0' Running command git checkout -q 99b4bd8f3ce9e9e4352975b13daff4e83e7e8d4b Resolved https://github.com/desihub/desispec.git to commit 99b4bd8f3ce9e9e4352975b13daff4e83e7e8d4b Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.
(redrock_env) C:\Users\Ed\Documents\Ed\Ed@_Astronomy_Research\DESI\DESI\File_Analysis_Software\Visualization_Software\redrock> (redrock_env) C:\Users\Ed\Documents\Ed\Ed@_Astronomy_Research\DESI\DESI\File_Analysis_Software\Visualization_Software\redrock>
I don't have a windows machine for testing, maybe another user or contributor could take a look
Thank you for looking into it. I decided to install Ubuntu on a virtual machine in my Windows OS and that fixed the problem. It is working fine now.
I'm trying to get things working on windows, but its slow going as I have to debug using the continious integration. See here #405
If you have any pointers on why its not finding the cfitsio headers I would be grateful
I came across that same problem with cfitsio. I probably spent a day on it. After coming up empty, I just moved everything to the Linux WSL and resigned myself to work in that environment. I am still working on the problem though and if I come up with anything I will let you know.
I've hit the same issue on a Windows machine. Unfortunately I don't have a solution on hand. Could we rename this to include "on Windows" please? I'll remember to share a solution if I do happen across it, but for now I'll also move to WSL.
Windows 11, python 3.12, pip 25.1.1, pip install fitsio:
.
.
.
File "C:\Users\radonn\AppData\Local\Temp\pip-build-env-ly4bmm68\overlay\Lib\site-packages\setuptools\command\build_ext.py", line 96, in run
_build_ext.run(self)
File "C:\Users\radonn\AppData\Local\Temp\pip-build-env-ly4bmm68\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 368, in run
self.build_extensions()
File "<string>", line 118, in build_extensions
AttributeError: 'Compiler' object has no attribute 'compiler'. Did you mean: 'compile'?
Any ideas why it seems to compile in the github windows environment, the one used for CI tests, but not in your setup?
Sounds good. Thanks!
Ed
Ed Mullen @.*** Sycamore Canyon Observatory https://scosci.com/ 8990 East Fernbush Court Vail, Arizona 85641 310-674-2846
From: Ross Donnachie @.> Sent: Monday, May 26, 2025 11:08 PM To: esheldon/fitsio @.> Cc: Ed Martin @.>; Author @.> Subject: Re: [esheldon/fitsio] Error when using pip install for fitsio (Issue #403)
[https://avatars.githubusercontent.com/u/28019482?s=20&v=4]radonnachie left a comment (esheldon/fitsio#403)https://github.com/esheldon/fitsio/issues/403#issuecomment-2911219462
I've hit the same issue on a Windows machine. Unfortunately I don't have a solution on hand. Could we rename this to include "on Windows" please? I'll remember to share a solution if I do happen across it, but for now I'll also move to WSL.
— Reply to this email directly, view it on GitHubhttps://github.com/esheldon/fitsio/issues/403#issuecomment-2911219462, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJDB5K7QCO4EQ3WQCBRV2ID3AP6M7AVCNFSM6AAAAAB57BMSY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMJRGIYTSNBWGI. You are receiving this because you authored the thread.Message ID: @.***>