How to install C++ 14.0 Offline and make python aware of it?

Viewed 7604

I am trying to figure out how to install c++ 14.0 offline using suggestions from other Stackoverflow Q&A. But none of them seem to work. I need it for Cython. I don't want to install the binary version. I installed suggested redistributables and then restarted the server for paths to be applied properly but when I pip install cython.tar it still does not find the c++ 14.0 dependency. Any help would be greatly appreciated.

The following are links to what I have installed based on other Stackoverflow answers:

Microsoft Build Tools 2015: https://www.microsoft.com/en-za/download/details.aspx?id=48159

Windows 10 SDK ISO: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

Then I restarted the windows server and I even ran the following command suggested by some other answers: python -m pip install setuptools --upgrade

4 Answers

After months of researching and trying all sorts of methods the following has worked:

Step 1: Download the build_tools.exe of your choice

Step 2: Make sure you are on a machine with the exact same environment you are going to install the c++ dependencies on. i.e. If server is windows server 2016 64bit run a vm to emulate that exact environment.

Step 3: Goto this site to get a list of all possible components you can download in the next step - https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2019

Step 4: Follow the following instructions to get a local cache download of your choice - https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019

Step 5: copy everything to the server and continue following the instructions from step 4

Step 6: restart the machine to apply paths properly

Step 7: copy rc.exe and rcdll.dll from C:\Program Files (x86)\Windows Kits\8.0\bin\x86 to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin

Step 8: Download the latest setuptools from pypi.org

Step 9: run the following command with admin rights python -m pip install path/to/setuptools.tar --upgrade

Step 10: Restart machine again to apply paths.

Once all steps are followed c++ 14.0 (or of your choice) will be installed properly and linked with no issues.

Install chocolatey, then use their script to install Visual Studio 2019 build tools, better use following command:

choco install visualstudio2019buildtools --package-parameters "--allWorkloads --includeRecommended --includeOptional --passive --locale en-US"

After that you will see Visual Studio GUI installer where you can manually select packages needed (be aware of size)

Source: https://chocolatey.org/packages/visualstudio2019buildtools

According to this site, "Another option is to use Microsoft’s Visual C. One must then use the same version which the installed Python was compiled with." It's likely you're not on a matching version. Cython itself recommends MinGW, which is easy enough to install following the directions on their site. Just make sure the compiler and standard library are in your Windows PATH. I believe they have to be added manually, which is pretty easy in Windows 10.

  1. download visualcppbuildtools_full.exe file and execute.

  2. unselect all the checkboxes.

  3. install button will be shown, click it.

restart pc and it's done.

Related