3

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

3
  • 1
    By "C++ 14.0", do you mean the compiler (Visual Studio 2015) or the Visual Studio C++ Runtime for 2015? If the latter, you may need to source the vcvarsall.bat file to set the appropriate environment variables. Did the build tools install cl.exe (the compiler) anywhere onto your system?
    – Botje
    Oct 22, 2019 at 7:28
  • @Botje I think it's the compiler that I need for python to install these non native dependencies? I can't find anything like cl.exe anywhere nor vcvarsall.bat. I just came across this link: learn.microsoft.com/en-us/visualstudio/install/… Not sure if this will solve my problem but will keep it this post updated with any findings. Oct 22, 2019 at 7:42
  • 1
    According to scivision.dev/python-windows-visual-c-14-required you need to explicitly select the C++ build tools when installing the build tools.
    – Botje
    Oct 22, 2019 at 7:43

4 Answers 4

5

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://learn.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://learn.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.

1
  • 1
    Oh step 7 bit me once too. But with a different setup wrt versions involved.
    – rubenvb
    Oct 24, 2019 at 9:40
2

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

2
  • 3
    Does this fulfil the "offline" part of question?
    – DavidW
    Dec 24, 2020 at 12:20
  • 1
    Probably its just an alternative way to install Build tools. I had a problem when web installer of Build tools didn't work. I believe this may help somebody with Visual C++ installation, although the way is not completely "offline" by mean "download the final C++ package in just one step".
    – klapshin
    Dec 26, 2020 at 1:09
0

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.

2
  • So I also tried these methods but the environment I am working in is extremely strict so even this method failed. Oct 24, 2019 at 8:46
  • MinGW can be installed anywhere and doesn't require admin rights. While I can see it both ways, you should still be able to modify your user environmental variables. If this is for work, they will either have an established method of doing this (this being getting your Dev environment set up), or you'll just have to submit a ticket to get the permissions you need.
    – sweenish
    Oct 24, 2019 at 12:46
0
  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.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.