'how to fix 'auto-py-to-exe' is not recognized as an internal or external command, operable program or batch file

I have python 3.9 I used the command 'pip install auto-py-to-exe' and it downloaded but when I tried to using the command 'auto-py-to-exe' the program just said " 'auto-py-to-exe' is not recognized as an internal or external command, operable program or batch file.". I have the latest version of PIP and I also have PATH. What can I do to fix this?



Solution 1:[1]

This works on VSCode:

python -m auto_py_to_exe

Solution 2:[2]

If I install "auto-py-to-exe" using following command, as described in this link as well as from the comment from Justin Ezequiel (above):

python -m pip install auto-py-to-exe

I am able to run it (in Windows 10) using following command:

python -m auto_py_to_exe

Solution 3:[3]

First you need to type in the terminal (not Python):

auto-py-to-exe 

If you are currently in python use exit() to exit then try the above code.

Solution 4:[4]

It Depends on in which environment you have installed

Make sure to replace {User} with your user

In Conda Enviournment go to below location Manually

C:\Users\{User}\anaconda3\Scripts\auto-py-to-exe.exe

In Pip, Environment go to the location below

C:\Users\{User}\AppData\Local\Programs\Python\Python37-32\Scripts\auto-py-to-exe.exe

or you can add this path to your environment variable as well for accessing these from anywhere

Solution 5:[5]

First check you installed it

pip install auto-py-to-exe

then restart your vscode and check another time. If still an error, check it in CMD.

Solution 6:[6]

As suggested above use:

pip show --files auto-py-to-exe to find out in what directory pip has installed the scripts. Double check the directory is in %PATH%

This will show you where the installer has placed the binary files. I then changed to that directory which circumvents any path issue. I tried to run the files and found :

OSError: [WinError 1920] The file cannot be accessed by the system: 'C:\\Users\\aaaa\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\python.exe'
PS C:\users\aaaa\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\Scripts>

In my case, although I haven't worked out how to fix it yet... It would seem to be trying to refer to an incorrect Python executable, the files in that directory are all 0 length. Unfortunately the "python -m" suggestion didn't work for me, so it's back to the drawing board. Hope that helps you confirm if it's the right solution to chase down.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tomerikoo
Solution 2 Aananth C N
Solution 3 Shivam Roy
Solution 4 SHYAM SHEEL
Solution 5 Ali FGT
Solution 6 Rob