Skip to content

mscvrt not found when calling fits.open() on Python 3.5 on Win10 #4342

Closed

Description

@and-colonna

When using fits.open(...) on Python 3.5 / Windows 10, I got error message:

C:\Python35\lib\site-packages\astropy\io\fits\util.py:577: UserWarning: Could not find appropriate MS Visual C Runtime library or library is corrupt/misconfigured; cannot determine whether your file object was opened in append mode.  Please consider using a file object opened in write mode instead.
  'Could not find appropriate MS Visual C Runtime '

I think pyreadline/pyreadline#32 (or parent issue ipython/ipython#8316 - specifically the phrase "ctypes.util.find_msvcrt() could be broken") might be related.

Activity

  1. embray commented on Nov 24, 2015

    @embray
    Member

    Indeed, it is the same issue (that is, the use of ctypes.util.find_msvcrt). In the case of astropy.io.fits it isn't really a serious issue, but good to know about so thanks for pointing it out.

  2. eteq commented on Dec 2, 2015

    @eteq
    Member

    So is this something that can be fixed in astropy, or does it require a more up-to-date pyreadline? (That is, should we close this and/or add it to the "known issues" list?)

  3. embray commented on Dec 2, 2015

    @embray
    Member

    @eteq This has nothing to do with pyreadline--it's just that the same bug is there. This is something that needs, presumably, to be fixed in Astropy (really it's an upstream issue in Python that needs to be worked around).

  4. embray commented on Dec 21, 2015

    @embray
    Member

    Also, it occurs to me that this warning is coming up in contexts where it's really pretty irrelevant. It is only relevant when opening the file with mode='append', and passing in an open file handle. The code here is trying to determine that the raw file handle was opened in append mode (or at least write, in which case we can emulate append). In the case of just passing in a filename we don't care, and the user shouldn't be bothered with this. But changing this will require yet another bit of refactoring of the _File class.

  5. astrofrog commented on Jan 8, 2016

    @astrofrog
    Member
    • Once the issue is fixed, Python 3.5 should be un-marked as an allowed failure in appveyor.yml
  6. anntzer commented on Apr 12, 2016

    @anntzer
    Contributor
  7. eteq commented on Apr 19, 2016

    @eteq
    Member

    @MSeifert04 pointed out that #4792 fixes this (suggested by the 3.5 tests now passing), so I'll close this.

    It's possible there's some additional problems that the #4792 fix uncovered that create this - it's not completely clear to me if the test suite actually covers this. But I think so? If not, this can be re-oepend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions