Skip to content

mt.exe could not be found using Visual Studio 2015 #254

Closed

Description

@Thraka

I'm trying to use Visual Studio 2015 python support but I cannot install through pip. I get this error

File "C:\Users\adegeo\AppData\Local\Temp\pip-build-qas0tfba\pythonnet\setup.py", line 95, in _find_msbuild_tool
raise RuntimeError("%s could not be found" % tool)
RuntimeError: mt.exe could not be found

How can I fix this?

Activity

  1. den-run-ai commented on Aug 31, 2016

    @den-run-ai
    Contributor

    can't you pip install from wheel (.whl)? mt.exe is only used when it is
    compiling it locally. if you are intentionally building from source, then
    do you even have mt.exe on your machine? what is the path to mt.exe? if
    not, then you can get it with WinSDK or C++ build tools for VS.

    if you are still getting issues, then what is your python version?

    On Wed, Aug 31, 2016 at 2:37 PM, Andy De George notifications@github.com
    wrote:

    I'm trying to use Visual Studio 2015 python support but I cannot install
    through pip. I get this error

    File "C:\Users\adegeo\AppData\Local\Temp\pip-build-qas0tfba\pythonnet\setup.py", line 95, in _find_msbuild_tool
    raise RuntimeError("%s could not be found" % tool)

    RuntimeError: mt.exe could not be found

    How can I fix this?

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #254, or mute the thread
    https://github.com/notifications/unsubscribe-auth/AHgZ5TC4Oq14hvZV8p2yOK5dgckhaFonks5qldgNgaJpZM4Jx-43
    .

  2. Thraka commented on Aug 31, 2016

    @Thraka
    Author

    So I created a new Python project in visual studio. Created a new venv for the project and then right-click > install package > pythonnet and it fails to install via pip.

    Do you mean to suggest that I should download the .whl file and install it through pip directly instead of just using pip install pythonnet?

  3. Thraka commented on Aug 31, 2016

    @Thraka
    Author

    Interesting.. I ran upgrade pip in visual studio and it went from version 7 to 8, tried to install and it worked fine. Odd. Closing.

  4. AlexCatarino commented on Jun 20, 2018

    @AlexCatarino
    Contributor

    @denfromufa, mt.exe is used to create the manifest in Windows. Is it really necessary? If I want to install pythonnet locally, do I need to install "Visual C++ for Python"?
    I made this change in setup.py to avoid this requirement:
    AlexCatarino@dbfcf73

  5. den-run-ai commented on Jun 20, 2018

    @den-run-ai
    Contributor

    @AlexCatarino manifest is needed to avoid CPython runtime crash due to incompatibility in MSVC runtime version:

    #45

    So pythonnet will work normally but fail very badly in other cases due to subtle issues with MSVC runtime WITHOUT manifest. This is quite common with Anaconda.

  6. AlexCatarino commented on Jun 20, 2018

    @AlexCatarino
    Contributor

    Thank you, @denfromufa!

  7. den-run-ai commented on Nov 29, 2018

    @den-run-ai
    Contributor

    @AlexCatarino here is how to avoid using mt.exe, probably worth investigating to avoid dependance on C/C++ build tools:

    https://stackoverflow.com/a/422063/2230844

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions