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

11

5

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?

Crosscheck answered 5/6, 2021 at 17:1 Comment(2)
Reinstall using python -m pip install auto-py-to-exe then run it using python -m auto_py_to_exe. This ensures that you are using the same python interpreter in both instances.Pause
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%Prime
R
10

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
Rummer answered 16/1, 2022 at 16:8 Comment(0)
S
7

This works on VSCode:

python -m auto_py_to_exe
Samy answered 13/11, 2021 at 8:46 Comment(0)
L
2

This gave me quite a bit of trouble, as none of the above solutions worked for me. Spent lots of time trying to figure out what I should be adding to PATH with no success.

My issue stemmed from (I think) the fact that I have been using python downloaded from the windows store, which uses a different location to store python in.

With the manual install of python (https://www.python.org) you can specify where python is downloaded and automatically add that location to path.

Steps I took to solve the problem:

  1. Uninstall all versions of python downloaded from the windows store via settings (settings > apps > python > uninstall)

  2. Uninstall all version of python via the control panel (control panel > add or remove programs > python x.x.x > uninstall)

  3. Uninstall auto-py-to-exe (pip uninstall auto-py-to-exe) in case it didnt do that automatically

  4. Install python from python.org. (auto-py-to-exe is not supported in versions greater than 3.10 as of 1/23/2023). So I installed Python 3.10

  5. The settings which were successful for me were: Custom installation, check install python for all users, check add to path, input 'C:\Python310' (with the respective version number) for install location, install

  6. Check new python version has been installed python --version

  7. Check pip is installed pip --version

  8. Install auto-py-to-exe pip install auto-py-to-exe

When auto-py-to-exe finishes installing, scroll up through the install info and make sure there are no warnings that state there is a location not found in PATH. If there are, you'll have to do some other research on adding those locations to PATH appropriately (since I don't think I was doing that right).

Assuming no PATH warnings, 9. Run auto-py-to-exe

Limousine answered 23/1, 2023 at 23:11 Comment(0)
L
0

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.

Listerism answered 5/6, 2021 at 17:11 Comment(0)
B
0

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

Bin answered 5/6, 2021 at 19:11 Comment(0)
M
0

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.

Mediate answered 13/11, 2021 at 12:20 Comment(1)
OP said they did this alreadyBreathy
Q
0

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.

Quadruplet answered 22/11, 2021 at 16:50 Comment(0)
D
0

You need to make sure you have typed cd C:\Users\your_user_name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts as a separate command, and then auto-py-to-exe in command prompt. Check in file explorer to make sure your path is correct if the cd fails.

Delao answered 16/8, 2022 at 1:32 Comment(1)
Use inline code formatting. It improves readibilityContortion
M
0

Try this

This was the only thing which worked for me

Open cmd and type:

pip uninstall auto-py-to-exe

Then

pip uninstall pyinstaller

then close the terminal

and reopen it

then type

pip install auto-py-to-exe

Important: Press Alt + F4 and from the menu select restart and press Ok

After Restart, open cmd

and Try

auto-py-to-exe

idk if it will work for you, but it worked for me.

Mccloskey answered 3/9, 2023 at 7:56 Comment(0)
C
0

auto-py-to-exe is a file, if executable file, should be with extension .exe, so the filename is auto-py-to-exe.exe. Then auto-py-to-exe is an executable file. Just type auto-py-to-exe at the OS prompt or double click in rapid succession in the directory in Windows. The auto-py-to-exe file executes and prompts you to specify the .py file. The .py file will be converted to .exe. The Python program file runs without the Python compiler and runs smoothly if there are no bugs.

Costermonger answered 29/2 at 11:56 Comment(1)
Eratum: Just type auto-py-to-exe st the OS prompt......Costermonger
F
-1

1. Check if you have it installed.

Open up your terminal / CMD / PowerShell and run py -m pip install auto-py-to-exe

2. Try to start it again

Open up your terminal or on windows PowerShell and run auto-py-to-exe, if its still not working, run py -m auto-py-to-exe

3. Still not working?

Try repeating step 2 but this time open your Terminal / CMD / PowerShell with administrator privileges and if its still not woring, try restarting your computer and repeat step 2 and 3 again.

Functional answered 4/9, 2023 at 18:44 Comment(1)
This duplicates other answers and adds no new content. Other uses have recommended the same command line commands in the same exact order. Please don't post an answer unless you actually have something new to contribute. You can show your support for an original answer by upvoting.Lyontine

© 2022 - 2024 — McMap. All rights reserved.