Say, you are installing a Python package for pyEnchant or crfsuite, etc. It fails to install and in the error trace it says some .bat
(or .dll
) file is missing.
A few forums suggest you install Visual Studio and a few others give work-arounds like cygwin, mingw, etc.
Why do some Python packages require Visual Studio?
In Visual Studio 2019, you can run and debug code without having a Visual Studio project file. See Quickstart: Open and run Python code in a folder-2019 for an example. In Visual Studio 2022, you can run and debug code without having a Visual Studio project file.
Install Python support in Visual Studio Python support is presently available only on Visual Studio for Windows. On Mac and Linux, Python support is available through Visual Studio Code. Download and run the latest Visual Studio installer for Windows. Python support is present in the release 15.2 and later.
For example, if you installed Anaconda 3 before installing Visual Studio, you don't need to install it again through the Visual Studio installer. You can also install an interpreter manually if, for example, a newer version of available that doesn't yet appear in the Visual Studio installer.
To install a package, right-click the desired environment in the Solution Explorer, then click Install Python Package. In the search box, type matplotlib, then click on pip install matplotlib from PyPI. Once installed, the package appears in the Python Environments window.
Why do some Python packages require Visual Studio?
Installation from source of CPython extension modules written in C requires a C compiler. Visual Studio provides one such compiler.
To avoid it, use binary installers such as these.
Also, due to licensing restrictions, an extension module may not install some dlls automatically and you have to install Visual Studio that provides these dlls manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With