How can i add visual studio build tools in a pyinstaller run? - python-3.x

I'm trying to develop a minimization alghorithm for master thesis task. I used cvxpy and i'd like to make an installer, since it would be very interesting for remaining research group that do not use python. As described in the installation documentation, cvxpy need visual studio build tools for python 3.
This complicate the stuff: how can i use pyinstaller and create a directory in which are already embedded also all visual studio dependencies needed for cvxpy? If this is not possible, how can i setup Inno setup in order to install visual studio build tools for python 3 before installing my application, taking only the necessary package from visual studio build tools?

Build a bootloader for PyInstaller
Download Build Tools for Visual Studio 2019 from Microsoft.
Run the vs_BuildTools.exe downloaded in the previous step.
Select “C++ build tools”
Install/upgrade setuptools: $ pip install setuptools --upgrade.

Related

Why is MSVC not installing or being recognized by Rust?

I've tried this repeatedly and still can't figure out where I'm going wrong.
I installed Rust from the official website (version 1.44.1), and I can run rustc --version and get the right result. I can create a new project, but when I run cargo test or cargo build, I get errors.
Compiling hello-rust v0.1.0 (C:\Projects\rust-test\hello-rust)
error: linking with `link.exe` failed: exit code: 1
|
= note: "link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Projects\\rust-test\\hello-rust\\target\\debug\\deps\\hello_rust-3bd7255de8fc516c.2475ppgeya7982p6.rcgu.o" "C:\\Projects\\rust-test\\hello-rust\\target\\debug\\deps\\hello_rust-3bd7255de8fc516c.2k8om5gztlm4khis.rcgu.o" "C:\\Projects\\rust-test\\hello-rust\\target\\debug\\deps\\hello_rust-3bd7255de8fc516c.2npazqbfnne9a4sz.rcgu.o" "C:\\Projects\\rust-test\\hello-rust\\target\\debug\\deps\\hello_rust-3bd7255de8fc516c.31mw3i7sxv4jy5mf.rcgu.o" "C:\\Projects\\rust-test\\hello-rust\\target\\debug\\deps\\hello_rust-3bd7255de8fc516c.39lo872ze2g8kjy6.rcgu.o" "/OUT:C:\\Projects\\rust-test\\hello-rust\\target\\debug\\deps\\hello_rust-3bd7255de8fc516c.exe" "C:\\Projects\\rust-test\\hello-rust\\target\\debug\\deps\\hello_rust-3bd7255de8fc516c.3pzk8mfjqu22abeg.rcgu.o" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis" "/LIBPATH:C:\\Projects\\rust-test\\hello-rust\\target\\debug\\deps" "/LIBPATH:C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libtest-ce9bcda9bff89d22.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libterm-5685a6e382a0344d.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libgetopts-9672beb79727d086.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunicode_width-0b6119489f498de7.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_std-f43d3b6a5d7adb85.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-13b0a7dd239e134e.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-c6983deeb3795666.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-fb1f6de11ac9d69b.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-09135599e2aa779b.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libbacktrace-4aec9f98c25f9f5d.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-29671087b5d92459.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-7c5d84958fafcb64.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-c820fe24a63d105a.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-eab51dcd5481cddb.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-da92c312ae6fecdd.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-693c88df9572eb34.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-b5aae910499df009.rlib" "C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-9a7454af4f639d0b.rlib" "kernel32.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
= note: /usr/bin/link: extra operand ‘/LIBPATH:C:\\Users\\Jaden\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib’
Try '/usr/bin/link --help' for more information.
error: aborting due to previous error
error: could not compile `hello-rust`.
To learn more, run the command again with --verbose.
My research has turned up something about MSVC not being set up properly or something missing from the PATH variable. What does this error mean? I have Visual Studio 2017 installed (just the basics, I didn't check any of the workloads or individual components), and to my knowledge, that is MSVC (Microsoft Studio Visual C++). I'm new to Rust and low-level coding in general (I'm a Python/JavaScript guy), so I don't really understand what I need to do here. Could anyone give me guidance here?
Why is MSVC not installing or being recognized by Rust? What could cause this? How can I fix it?
I happened to find the answer by myself which I didn't find documented anywhere with regards to Rust. I searched longer about installing MSVC and found this Microsoft page: https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation?view=vs-2019
For core C and C++ support, choose the "Desktop development with C++" workload.
I modified my installation and selected the Desktop development with C++ workload. That worked!
When you install Rust using rustup-init.exe it should automatically detect whether you have the Microsoft C++ build tools installed. If they are not installed, it will give you a detailed message on how to install them as the very first thing.
This is what it looks like on Windows 10:
Rust Visual C++ prerequisites
Rust requires the Microsoft C++ build tools for Visual Studio 2013 or
later, but they don't seem to be installed.
The easiest way to acquire the build tools is by installing Microsoft
Visual C++ Build Tools 2019 which provides just the Visual C++ build
tools:
https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
Please ensure the Windows 10 SDK and the English language pack components
are included when installing the Visual C++ Build Tools.
Alternately, you can install Visual Studio 2019, Visual Studio 2017,
Visual Studio 2015, or Visual Studio 2013 and during install select
the "C++ tools":
https://visualstudio.microsoft.com/downloads/
Install the C++ build tools before proceeding.
If you will be targeting the GNU ABI or otherwise know what you are
doing then it is fine to continue installation without the build
tools, but otherwise, install the C++ build tools before proceeding.
Continue? (Y/n)

How to add a CMAKE generator to the Linux version of CMAKE?

I am on a Windows machine running the Windows Subsystem for Linux. When I installed the CLI version of CMAKE on the WSL it did not come with any generators for visual studio (i.e. Visual Studio 15 2017 Win64).
How do I add these to the Linux version of CMAKE?
No can do. As per CMake's documentation:
CMake Generators are platform-specific so each may be available only on certain platforms. The cmake(1) command-line tool --help output lists available generators on the current platform.
Even if you built CMake yourself, you wouldn't be able to compile the Visual Studio generators because they rely on the Windows API.

How to install Visual Studio 2015 PlatformSDK now?

When I ran something (such as pip install scrapy) with python 3.7, I got a trouble with
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
and I found there is no PlatformSDK in my VS 14.0 at all.
(Update on 24 Jul 2018: I got another error [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1\\lib' when I ran pip install scrapy on another laptop, also Win 10 OS. I'm not sure whether my case is similar to this question's)
Then I got a vs_community.exe source from here and installed Web Developer Tools and Visual Studio Extensibility Tools Update 3 successfully, but still no PlatformSDK.
So how can I get this missing folder and its packages inside it?
Once I had a problem installing another Python program (QARK) that required Windows Visual C++. In fact in cmd / PowerShell I was told that a required version was missing.
So I followed what was written on THIS site, so I didn't have this problem anymore (I also rebooted, for safety):
Install using any ONE of these choices:
Microsoft Build Tools for Visual Studio
Alternative link to Microsoft Build Tools for Visual Studio.
Offline installer: vs_buildtools.exe
Select: Workloads → C++ build tools.
Install options: select only the “Windows 10 SDK” (assuming the computer is Windows 10). Optionally, if you want to use MSVC cl.exe C/C++ compiler from the command line, additionally select the C++ build tools, which takes an additional 2 GB disk space.
After that I didn't have any problems running it.
I hope I have been helpful! 🤞

Can't get qwt_designer_plugin to load in Qt Creator

My setup is:
Visual Studio 2012
Qt 5.2.0 from
http://download.qt-project.org/official_releases/qt/5.2/5.2.0/qt-windows-opensource-5.2.0-msvc2012-x86_64-offline.exe
Unzip Qwt from http://sourceforge.net/projects/qwt/files/qwt/6.1.0/qwt-6.1.0.zip/download to C:\qwt-6.1.0
Opened Qt 5.2.0 64-bit for Desktop (MSVC 2012) and ran "qmake qwt.pro"
Opened VS2012 x64 Native Tools Command Prompt and ran "nmake" and "nmake install"
Set QWT_ROOT = C:\qwt-6.1.0
Added C:\qwt-6.1.0\lib to PATH
Copied C:\qwt-6.1.0\plugins\designer\qwt_designer_plugin.dll to C:\Qt\Qt5.2.0\Tools\QtCreator\bin\plugins\designer
When I open Qt Creator and edit the UI then go to Tools->Form Editor->About Qt Designer Plugins I see "Cannot load library qwt_designer_plugin.dll:" but no error or reason.
I used Dependency Walker to check the Dll, and QtCreator.exe and all its dependencies are 32-bit whereas my build of qwt_designer_plugin.dll is 64-bit. I wondered if this was causing the problem so I:
Downloaded Qt5.2.0 from http://download.qt-project.org/official_releases/qt/5.2/5.2.0/qt-windows-opensource-5.2.0-msvc2012-x86-offline.exe and install into C:\Qt\Qt5.2.0-32
Unzipped Qwt into C:\qwt-6.1.0-32bit to create a fresh copy.
Opened Qt 5.2.0 32-bit for Desktop (MSVC 2012), cd into C:\qwt-6.1.0-32bit and "qmake qwt.pro"
Opened VS2012 x86 Native Tools Command Prompt and ran "nmake" and "nmake install"
Copied C:\qwt-6.1.0-32bit\designer\plugins\designer\qwt_designer_plugin.dll to C:\Qt\Qt5.2.0\Tools\QtCreator\bin\plugins\designer
This works fine and I can now see the plugin loaded correctly and add Qwt widgets in the UI designer.
This worked for me:
Step 1
I check what MSVC version the QtCreator in my Qt framework version was built with. E.g. QtCreator that comes with Qt_5.6.2 MSVC2015 (qt-opensource-windows-x86-msvc2015-5.6.2.exe) was built with MSVC 2013 (qt-opensource-windows-x86-msvc2013-5.6.2.exe).
Step 2
I install qt-opensource-windows-x86-msvc2013-5.6.2.exe and build Qwt(plugin) with that Qt version.
For comparison here is what happens when Qwt is built with Qt_5.6.2 MSVC2013 and Qt_5.6.2 MSVC2015:
Also here:
https://stackoverflow.com/a/20156419/3096593

VS2012 Install Shield project building using TFS build definition

I have a VS2012 sln which includes an install shield installer project.
If I build the solution/projects manually via solution explorer everything builds fine.
However when using the TFS build definitions i get the following error:
C:\Builds\1\<NAME>\<Build_Definition_Name>\Sources\InstallSetup\InstallSetup.isproj (29): The imported project
"C:\Program Files (x86)\MSBuild\InstallShield\2012SpringLimited\InstallShield.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
Can someone please help with this?
Info:
Using VS 2012
OS - Win 7 x64 Pro
You need to install InstallShield on the machine on which you are running the build.
In-case someone is facing the same issue, I was able to solve it by reading what Flexera mentioned on their website: Link
Brief description: in build definition, process tab, make sure the MSBuild Platform is targeting x86.
I too had 64bit Windows (8.1) running and Team Foundation Server 2013 Express.

Resources