Fix Command cl.exe Failed: No Such File or Directory in Windows

Rohan Timalsina Sep 13, 2022
Fix Command cl.exe Failed: No Such File or Directory in Windows

pip is a tool for Python that allows you to install and manage packages. Python needs a C compiler to install packages such as spacy, pyodbc, pychm, and so on because they are partly built with C/C++.

The command: 'cl.exe' failed error occurs when you use pip to install the package that requires a C compiler.

This tutorial will teach you how to fix the command 'cl.exe' failed: No such file or directory error in Windows.

Fix the command 'cl.exe' failed: No such file or directory Error in Windows

You must install the Visual Studio C++ compiler on your computer to solve this problem. If your system already has Visual Studio, you can install Desktop development with C++ from the Visual Studio Installer to fix the issue.

Install Desktop Development With C++

If not, you can download Build Tools for Visual Studio from Visual Studio’s official download page. Then run the installer to install C++ build tools on your computer.

Install C++ Build Tools

After completing the installation, open the Native Tools command prompt from the Visual Studio folder. It will automatically set the PATH in environment variables so that the cl.exe can be found.

In our case, the folder is C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2022\Visual Studio Tools\VC.

If you cannot locate the folder, search native tools on your computer and open the command prompt according to your operating system.

Open Native Tools Command Prompt

  • For 32-bit, use x86 Native Tools Command Prompt.
  • For 64-bit, use x64 Native Tools Command Prompt.

Now the error command 'cle.exe' failed: No such file or directory should be fixed, and the command should work without errors.

The C++ compiler is essential for packages that are written in C/C++. Otherwise, you will likely get the error command 'cle.exe' failed when installing such packages using pip.

We hope this tutorial has helped you to solve the issue.

Rohan Timalsina avatar Rohan Timalsina avatar

Rohan is a learner, problem solver, and web developer. He loves to write and share his understanding.

LinkedIn Website

Related Article - Python Error