Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Error ESPSFashTool Mac 12.4 #562

Open
k5beason opened this issue Sep 15, 2022 · 6 comments
Open

Python Error ESPSFashTool Mac 12.4 #562

k5beason opened this issue Sep 15, 2022 · 6 comments
Assignees

Comments

@k5beason
Copy link

Hello,

When trying to use the ESPSFlashTool.jar on My M1 Mac running 12.4 I get "java.io.IOException: Cannot run program "python": error=2, No such file or directory" in the terminal and I'm unable to flash.

python --version returns Python 3.8.9

I've tried both ver 3.2 and ver 4.0 beta 4.

@forkineye
Copy link
Owner

Have you tried running it from the command line? java -jar ESPSFlashTool.jar.

@k5beason
Copy link
Author

k5beason commented Sep 15, 2022

Have you tried running it from the command line? java -jar ESPSFlashTool.jar.

Yes. Its the only way the flash tool will open. No errors until I go to flash and then it states unable to connect, and in terminal it indicates the python error

entire error:
"java.io.IOException: Cannot run program "python": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at com.forkineye.espsflashtool.ESPSFlashToolUI$ImageTask.exec(ESPSFlashToolUI.java:460)
at com.forkineye.espsflashtool.ESPSFlashToolUI$ImageTask.doInBackground(ESPSFlashToolUI.java:512)
at com.forkineye.espsflashtool.ESPSFlashToolUI$ImageTask.doInBackground(ESPSFlashToolUI.java:442)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 9 more
java.io.IOException: Cannot run program "python": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at com.forkineye.espsflashtool.ESPSFlashToolUI$ImageTask.exec(ESPSFlashToolUI.java:460)
at com.forkineye.espsflashtool.ESPSFlashToolUI$ImageTask.doInBackground(ESPSFlashToolUI.java:518)
at com.forkineye.espsflashtool.ESPSFlashToolUI$ImageTask.doInBackground(ESPSFlashToolUI.java:442)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 9 more
"

@forkineye
Copy link
Owner

what does 'which python' return?

@k5beason
Copy link
Author

what does 'which python' return?

kbeason@MacBook-Pro ~ % which python
python: aliased to /usr/bin/python3

@forkineye
Copy link
Owner

forkineye commented Sep 15, 2022

Ah, you need to setup a symlink to python3 as the alias won't work from within java. Like ln -s /usr/bin/python3 ~/bin/python if you have a bin directory in your home and path. If not, sudo ln -s /usr/bin/python3 /usr/local/bin/python should work.

@k5beason
Copy link
Author

Ah, you need to setup a symlink to python3 as the alias won't work from within java. Like ln -s /usr/bin/python3 ~/bin/python if you have a bin directory in your home and path. If not, sudo ln -s /usr/bin/python3 /usr/local/bin/python should work.

Linking to the preinstalled python would trigger Xcode to install additional tools everytime the flash tool was run. Never worked even after installing the prompted tools.

I discovered I needed to download and install python3 from python.org and then used
sudo ln -s /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 /usr/local/bin/python

Both my M1 Macs have the same issue with python. Not sure if it can be addressed in future releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants