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

Fails to find python when creating arduino.mk #125

Closed
matthewg42 opened this issue Sep 8, 2019 · 6 comments
Closed

Fails to find python when creating arduino.mk #125

matthewg42 opened this issue Sep 8, 2019 · 6 comments

Comments

@matthewg42
Copy link

When building demo, I get:

Linking /tmp/mkESP/HelloServer_generic/HelloServer.bin                                   
  Versions: Unknown, 2.5.2                                                               
/bin/sh: /python: No such file or directory                                              
make: *** [makeEspArduino.mk:297: /tmp/mkESP/HelloServer_generic/HelloServer.bin] Error 127

Looking in /tmp/mkESP/HelloServer_generic/arduino.mk I can see it's not populating the full path to the python interpreter properly:

ELF2BIN_COM="/python" "$(ESP_ROOT)/tools/elf2bin.py" ... 

If I change it to the proper path /usr/bin/python, the build succeeds. How does it find any populate the python path in arduino.mk for the ELF2BIN_COM variable?

My system is Fedora 29.

@DerEros
Copy link

DerEros commented Sep 12, 2019

Same here with Arch Linux

@DerEros
Copy link

DerEros commented Sep 13, 2019

As a workaround, this worked for me. Not sure if it's meant to be like this. Seems that runtime.tools.python.path is missing, but I do not understand the workflow well enough to know, where it should really come from.

diff --git a/makeEspArduino.mk b/makeEspArduino.mk
index b09091e..2f06989 100644
--- a/makeEspArduino.mk
+++ b/makeEspArduino.mk
@@ -491,6 +491,7 @@ sub def_var {
    $$v{$$name} = "\$$($$var)";
 }
 
+$$v{'runtime.tools.python.path'} = '/usr/bin';
 $$v{'runtime.platform.path'} = '$$(ESP_ROOT)';
 $$v{'includes'} = '$$(C_INCLUDES)';
 $$v{'runtime.ide.version'} = '10605';

@plerup
Copy link
Owner

plerup commented Sep 15, 2019

Fixed in latest commit (for latest version of esp8266/Arduino)

@DerEros
Copy link

DerEros commented Sep 15, 2019

Thanks for the fix. I got mixed results:

With the last release of the ESP toolchain (2.5.2), which is the one that my Arduino IDE is still downloading, it still fails. The toolchain still refers to Python2 (see https://github.com/esp8266/Arduino/blob/2.5.2/platform.txt#L111).

With the newest version from Master (2.6.0-dev) the fix works fine, no more need for a workaround.

Update: should have read your whole comment, not only the first word :D

@plerup
Copy link
Owner

plerup commented Sep 15, 2019

Fixed now, thanks for pointing this out

@DerEros
Copy link

DerEros commented Sep 15, 2019

I can confirm that it now works with both toolchains.
Tried with "2.5.2" (Python 2) and "2.5.2-145-g8dd068eb" (Python 3).

Thanks! I think, the issue can be closed now.

@plerup plerup closed this as completed Sep 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants