Page 1 of 1

type error when build partitions_singleapp.bin

Posted: Tue May 29, 2018 2:03 am
by billmogen
Hi, everyone:
build error follow:
Building partitions from /Users/billmogen/workspace/esp/esp-idf/components/partition_table/partitions_singleapp.csv...
Traceback (most recent call last):
File "/Users/billmogen/workspace/esp/esp-idf/components/partition_table/gen_esp32part.py", line 423, in <module>
main()
File "/Users/billmogen/workspace/esp/esp-idf/components/partition_table/gen_esp32part.py", line 395, in main
table_size = table.flash_size()
File "/Users/billmogen/workspace/esp/esp-idf/components/partition_table/gen_esp32part.py", line 122, in flash_size
last = sorted(self, reverse=True)[0]
TypeError: unorderable types: PartitionDefinition() < PartitionDefinition()
make: *** [/Users/billmogen/workspace/esp/hello_world/build/partitions_singleapp.bin] Error 1
my environment:
mac os sierra 10.12.6
python version 2.7.5 or 3.5
xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0
esp-idf latest

Thanks for checking.
From Bill

Re: type error when build partitions_singleapp.bin

Posted: Tue May 29, 2018 4:35 am
by ESP_Angus
Hi Bill,

Is it possible your default Python version is Python 3? (You can check by running "python -V" in a terminal.)

ESP-IDF requires Python 2.x at the moment (we will be adding Python 3 support soon). You can change the Python interpreter in use under "make menuconfig" -> "SDK Tool Configuration" -> "Python 2 interpreter" and change "python" to "python2".

Re: type error when build partitions_singleapp.bin

Posted: Tue May 29, 2018 6:38 am
by billmogen
Hi Angus:
You are right! The python version of esp-idf was 3.5 at that time, I changed the python version to 2.7. It was successful building.
Actually, there were many python versions in my workspace, I tried to use pyenv to control them, I just modified one folder's python
version to 2.7 use "pyenv local" command, so it builded wrong .

Best reguards.
From Bill.