how to install wxpython to visual studio 2017 - visual-studio

I have installed python 3 and wxpython. Programs with
import wx
work when executed from the command line:
python helloworld.py
When I run the program with Visual Studio 2017, I get a build error:
ModuleNotFoundError: No module named 'wx'
My python environment is set to python 3. I don't understand how to include the wx module.

wxpython needs to be installed to Visual Studio:
In your project, under "Python Environments", right click on your python installation e.g. Python 3.6. In the dropdown menu, click on "install python package...".
Then select "install wxpython" from the list. Results are displayed in the output window. Wait for the install to complete i.e. wait for the green progress bar indicator to finish.

Related

Visual Studio 2022: System.InvalidOperationException: "git" is not present in PATH

I'm trying to compile the following project:
https://github.com/xoofx/markdig
In Visual Studio 2022, How to resolve the error message:
System.InvalidOperationException: "git" is not present in PATH.
What's the correctly way to install 'git' for visual studio? I thought Visual Studio Already has git installed out of the box, judging by the label "Git" on the menu bar.
Here's a picture of my screen:
Menu: Tools->Command-Line:
Thanks for adding the picture. You need to have git installed. This can be done independently or through visual studio installer.
https://git-scm.com/downloads
It will ask you during installation if you want it to be added to the path - choose yes.
Once you have installed, launch the command window from start menu
and run git command. That should show something like this -
[2]
Once you have git command running from command line it should work from visual studio as well. Essentially VS is trying to launch that command from its shell and failing to find it because you dont have git installed.
VS does come with git installed but you have to choose it in its workloads. You have to go through all available installation options. See the screenshot below from VS 2017 installation workload. You can do this by re-launching your VS installer and selecting the products that you want installed. Since I use most of the things, I dont uncheck anything but that takes close to 50Gig space on the disk - something you want to be aware of.

couldn't determine visual studio generator

I am trying to compile rust's azul gui framework sample code on windows 10 and it's running into the following error:
error: failed to run custom build command for `harfbuzz-sys v0.3.0 (https://github.com/maps4print/azul-dependencies?rev=bf2933b9aac43a7003278862772250398e4fa457#bf2933b9)`
Caused by:
process didn't exit successfully: `F:\Code\rust\azul_demo\target\debug\build\harfbuzz-sys-4d7deefbb1bf663c\build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=HARFBUZZ_SYS_NO_PKG_CONFIG
--- stderr
thread 'main' panicked at '
couldn't determine visual studio generator
if VisualStudio is installed, however, consider running the appropriate vcvars script before building this crate
', C:\Users\Andrew\.cargo\git\checkouts\azul-dependencies-70bb1f94316762f9\bf2933b\cmake-0.1.35\src\lib.rs:687:25
stack backtrace:
0: backtrace::backtrace::trace_unsynchronized
at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.29\src\backtrace\mod.rs:66
...
I installed cmake and visual studio 2019. Also note that I am using clion ide. Cmake version is 3.15.2.
It says I should run the appropriate vcvars script before building this crate, what does it mean exactly?
EDIT ----
Found vcvars.bat in the visual studio installation folder and ran it. It's still getting the same error.
EDIT2 ----
It looks like an incompatibility between the latest version of visualstudio(19) and cmake. Reverting to 2015 is suppose to resolve the issue.
https://github.com/maps4print/azul/issues/203
When you install Visual Studio, the command-line tools are not available from a generic command prompt. Visual Studio should have installed an entry in your start menu to start a properly configured console.
Or if you haven't started your console from this special entry, Visual Studio should also have installed a script called vcvars.bat somewhere in its install folder. You need to run that script before you can access the command-line tools.

Which "Individual Component" from the Visual Studio installer is suitable for Rust development?

I have a fully updated install of Visual Studio Enterprise 2017 (currently 15.9.2) on my machine, and I want to do some Rust coding. The Rust installer tells me to install "Visual C++" build tooling, but I can't seem to figure out which one is needed.
That is, I tried installing "VC++ 2017 version 15.9 v14.16", but when I do cargo run on my hello world application, it halts with a message:
error: linker link.exe not found
I don't want to go rampant and install all the C++ components in the installer, just the one I need. I'd prefer to install it as part of the Visual Studio installer, if possible.
Which "Individual Component" in the Visual Studio installer do I need for Rust?
Here's what's currently checked:
As a workaround, I was advised to run rustup default stable-x86_64-pc-windows-gnu which at least allows me to run the hello world example. (Or perhaps this is in fact a proper solution even?)
Installing any "VC++ toolset" should be enough to get cargo run to link properly. It looks like the minimum dependencies are:
Required dependencies are VC++ 2017 version 15.7 v14.14 latest v141 tools and Windows 10 SDK (10.0.17134.0)
Note that VC does not add its tools to the path (so that you can have multiple versions of the MS toolchain installed in parallel). Instead it adds entries to your Start menu like: "VC++ 2017 version 15.9 v14.16 command prompt" (not sure of the name), that allow you to start a command prompt with the proper path. This should also be possible from a VS toolbar button or menu entry.
You can't start cargo from a generic command prompt, you need to open the prompt with one of the above solutions.
Alternatively, you need to run c:\path\to\your\VS\installation\VCVARS.BAT inside your prompt to set the correct path before running cargo.

Anaconda installed but Python in Visual Studio does not recognize Numpy

I installed Anacoda and then Visual studio on windows 7 as explained in :
https://docs.continuum.io/anaconda/ide_integration#python-tools-for-visual-studio-ptvs
but my visual studio does not recognize Numpy and some other modules...
What should i do?
Did you check the list of available python packages from the solutions explorer? If already inside a project, you can right-click on the Python2.7(global environment) and try 'install package' and enter 'numpy' and install from 'pip' or 'conda'. (See ImageLink at the end of this paragraph). This should install numpy. ImageLink
You have to add to this PATH in the enviroment variables:
yourAnacondaPath/Library/bin
it worked for me.

Error "**We didn't find any interpreters**" in VS while running a code

Why do i get an error message "We didn't find any interpreters" when i try to run my code in Visual Studio python ?
Did you installed a proper Python interpreter? You installed it but Visual Studio can not find it? If yes go to menu View => Other Windows => Python Environments to see following window. Then set correct path of your python.
For more info see here.

Resources