Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set up the build environment #1489

Closed
marbx opened this issue Mar 21, 2020 · 7 comments · Fixed by #1490
Closed

How to set up the build environment #1489

marbx opened this issue Mar 21, 2020 · 7 comments · Fixed by #1490

Comments

@marbx
Copy link
Contributor

marbx commented Mar 21, 2020

I try to set up and document the build environment (for Python 3)

Related: #1487

This is a rewrite of https://wiki.python.org/moin/WindowsCompilers

Install Microsoft Visual C++ compiler for Python 3.5, 3.6, 3.7, 3.8

Microsoft Visual C++ 14.2 is in Visual Studio 2019

  • Download the Installer for Visual Studio 2019 (~ 1 MB)

  • In the installer:

    • Check C++ build tools
      • In the menue to the right, check:
        • MSVCv142 - VS 2019 C++ x64/x86 build tools
        • Windows 10 SDK
        • C++ MFC for latest v142 build tools (automatically ticks C++ ATL)
          • Note: The installer does not contain MFC for v140
      • Press Install (~ 5 GB)
  • Restart

  • Include the "Microsoft (R) Message Compiler" into the path

    • Search

      dir /b /s mc.exe

    • and set (example)

      set "path=%path%;c:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64"

  • Run

    python setup.py -q build

Error

RuntimeError: No MFC files found!

What am I missing/doing wrong?

Thank you

@marbx
Copy link
Contributor Author

marbx commented Mar 21, 2020

Error solved

MFC v140 is in Build Tools for Visual Studio 2017 (version 15.9), available at https://my.visualstudio.com.

The devblog explains (see Screenshot!)

The Visual C++ build tools workload in the Visual Studio Build Tools will install the latest v141 toolset from VS2017 by default. The v140 toolset from VS2015 will install side-by-side with the v141 toolset. To install them just select the “VC++ 2015.3 v140 toolset for desktop (x86,x64)” at the bottom of the “Optional” section.

@marbx
Copy link
Contributor Author

marbx commented Mar 22, 2020

Question:

  • Why do I need to include mc in the path?

@mhammond
Copy link
Owner

* Why do I need to include mc in the path?

mc is used in the build to embed message resources in a few of the built files. Is that what you are asking?

@marbx
Copy link
Contributor Author

marbx commented Mar 22, 2020

No, I don't question the reason for mc. Looks like an interesting technology.

I wanted confirmation that amending the path environment variable on its own completes the pywin32 build environment, and that I don't miss steps which include amending the path.

Thank you, I will create a pull request for a markdown document.

@vernondcole
Copy link
Collaborator

vernondcole commented Mar 24, 2020 via email

@marbx
Copy link
Contributor Author

marbx commented Mar 24, 2020

Hi @vernondcole, isn't that funny: I come to pywin32 because Salt uses it.

In particular, I would like to propose a headless distribution variant of pywin32, which fits even better into Salt.

I was also wondering how to test pywin32, so I can use the bevy, very handy.

@marbx
Copy link
Contributor Author

marbx commented Apr 27, 2020

@vernondcole, I have repeated the install on a second PC, so I have confidence in the "pull-down-this-and-click-that" description of the setup.

As you are aware, Salt uses pywin32.

I would like to build a pywin32 variant without MFC. This would exclude Pythonwin and Scintilla, and all other GUI elements, because Salt does not require, and therefore should not contain MFC.

I can ran python setup.py -q build.

Could you give me an advise how to proceed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants