Skip to content

Python TypeError when compiling sketch #236

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

Closed
xtaco opened this issue Feb 26, 2017 · 8 comments
Closed

Python TypeError when compiling sketch #236

xtaco opened this issue Feb 26, 2017 · 8 comments

Comments

@xtaco
Copy link

xtaco commented Feb 26, 2017

Hi All,

I am not able to compile any sketches due to this error. Anyone come across this?

Traceback (most recent call last):
  File "/home/user/Arduino/hardware/espressif/esp32/tools/gen_esp32part.py", line 356, in <module>
    main()
  File "/home/user/Arduino/hardware/espressif/esp32/tools/gen_esp32part.py", line 345, in main
    table.verify()
  File "/home/user/Arduino/hardware/espressif/esp32/tools/gen_esp32part.py", line 83, in verify
    for p in sorted(self):
TypeError: '<' not supported between instances of 'PartitionDefinition' and 'PartitionDefinition'
exit status 1
Error compiling for board ESP32 Dev Module.

@me-no-dev
Copy link
Member

check if there are no errors on your side in this file.

@carlgonz
Copy link

carlgonz commented Feb 27, 2017

Seems to be a problem with the default python version. The script gen_esp32part.py seems to work only with python2

@bessl
Copy link

bessl commented Mar 1, 2017

I had the same problem. I was using the Python 3 interpreter. You can fix it temporary by doing this:

mkdir /tmp/bin
PATH=/tmp/bin:$PATH
ln -s /usr/bin/python2 /tmp/bin/python

when you start arduino ide from your terminal window it should work!

@me-no-dev
Copy link
Member

I'll turn it into binary next time around and will not be a problem.

@me-no-dev me-no-dev added the Status: To be implemented Selected for Development label Mar 1, 2017
@mcgiver0510
Copy link

mcgiver0510 commented Mar 9, 2017

in ArchLinux you can
change this line in platform.txt
tools.gen_esp32part.cmd=python "{runtime.platform.path}/tools/gen_esp32part.py"
to
tools.gen_esp32part.cmd=python2 "{runtime.platform.path}/tools/gen_esp32part.py"
lg

@dmopalmer
Copy link

Is it worthwhile to make gen_esp32part.py compatible with python3, or will that just kick the problem to the next incompatible step?

This requires changing line 83 of gen_esp32part.py something like (untested code):

+        for p in sorted(self, key=lambda x:x.offset):
-        for p in sorted(self):

@me-no-dev
Copy link
Member

TBH I'm no python coder :) I get around with it and can write some stuff, but I am in no way intimate with it to the point where I know the differences between 2.7 and 3 and how to make things work.
maybe try/catch could do the trick for both versions?

@copercini
Copy link
Contributor

Solved here: espressif/esp-idf#577 =)

@VojtechBartoska VojtechBartoska added Status: Solved and removed Status: To be implemented Selected for Development labels Apr 6, 2022
darkxst pushed a commit to darkxst/arduino-esp32 that referenced this issue Dec 5, 2024
* fix(docker): Add docker tag to run scripts in 5.3 branch

* Add additional info
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

8 participants