Skip to content

Error when using pip install for fitsio on Windows #403

@SCO-SCI

Description

@SCO-SCI

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions