close

[Solved] Can’t find Python executable “python”, you can set the PYTHON env variable

To Solve Can’t find Python executable “python”, you can set the PYTHON env variable You need to set Python in the path variable OR you need to install windows-build-tools will resolve this error.

How Can’t find Python executable “python”, you can set the PYTHON env variable Error Occurs.

I am trying to NPM package but I am facing the following error in my terminal:

Can't find Python executable "python", you can set the PYTHON env variable

So here I am writing all the possible solutions that I have tried to resolve this error.

Solution 1: Install windows-build-tools

You need to install windows-build-tools and then Your error will be solved. Just run this command in your terminal.

npm i windows-build-tools

And Now, Your error will be solved. Thank You.

Note: Node.js now includes build tools for Windows. You probably no longer need a windows-build-tools tool.

Solution 2: set PATH variable

You just need to Install Python In Your Windows ( If Not Installed ) and then add python to your PATH variable. Using environment variable.

OR

You can set npm config set python path and it will also Solve your error. Just run this command in your terminal.

npm config set python E:\Programm Files\Python\python.exe

And Now, Your error must be solved.

Solution 3: Just Run this command

Open Your Cmd Using Admin Access And Run the following command.

npm install --global --production windows-build-tools

And now, Your error will be solved.

Frequently Asked Questions

  1. How To Solve Can't find Python executable “python”, you can set the PYTHON env variable Error?

    To Solve Can't find Python executable “python”, you can set the PYTHON env variable Error You just need to Install Python In Your Windows ( If Not Installed ) and then add python to your PATH variable. Using environment variable. OR You can set npm config set python path and it will also Solve your error. Just run this command in your terminal: npm config set python E:\Programm Files\Python\python.exe And Now, Your error must be solved.

  2. Can't find Python executable “python”, you can set the PYTHON env variable

    To Solve Can't find Python executable “python”, you can set the PYTHON env variable Error You need to install windows-build-tools and then Your error will be solved. Just run this command in your terminal: npm i windows-build-tools And Now, Your error will be solved. Thank You.

Conclusion

You need to set python.exe to the path variable and then your error will be solved. Hope Our article helped you to solve this error comment below which solution worked for you.

Also, Read

Leave a Comment