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?

Dima Chubarov
  • 16,199
  • 6
  • 40
  • 76
Vyom Bhandari
  • 69
  • 1
  • 1
  • 2
  • 4
    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. –  Jun 05 '21 at 17:11
  • `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%` – phd Jun 05 '21 at 17:21

9 Answers9

8

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
Aananth C N
  • 428
  • 7
  • 14
7

This works on VSCode:

python -m auto_py_to_exe
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Sear D
  • 81
  • 1
  • 6
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

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.

Shivam Roy
  • 1,961
  • 3
  • 10
  • 23
AaronJ97
  • 1
  • 2
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

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.

Ali FGT
  • 55
  • 8
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.

Rob
  • 141
  • 5
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.

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.