Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does installation of some Python packages require Visual Studio?

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?

like image 532
Alekhya Vemavarapu Avatar asked Oct 13 '15 10:10

Alekhya Vemavarapu


People also ask

Does Python 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.

Is Python installed with Visual Studio?

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.

Do I need to install Python before Visual Studio?

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.

How do I get Python packages in Visual Studio?

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.


1 Answers

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.

like image 141
jfs Avatar answered Sep 21 '22 12:09

jfs