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?
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
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:
Uninstall all versions of python downloaded from the windows store via settings (settings > apps > python > uninstall)
Uninstall all version of python via the control panel (control panel > add or remove programs > python x.x.x > uninstall)
Uninstall auto-py-to-exe (
pip uninstall auto-py-to-exe
) in case it didnt do that automaticallyInstall 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
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
Check new python version has been installed
python --version
Check pip is installed
pip --version
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
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.
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
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.
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.
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.
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 pressOk
After Restart, open cmd
and Try
auto-py-to-exe
idk if it will work for you, but it worked for me.
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.
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.
© 2022 - 2024 — McMap. All rights reserved.
python -m pip install auto-py-to-exe
then run it usingpython -m auto_py_to_exe
. This ensures that you are using the same python interpreter in both instances. – Pausepip show --files auto-py-to-exe
to find out in what directorypip
has installed the scripts. Double check the directory is in%PATH%
– Prime