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

Board: sipeed-maixduino, framework=arduino #19

Closed
fivefishstudios opened this issue Sep 21, 2019 · 7 comments
Closed

Board: sipeed-maixduino, framework=arduino #19

fivefishstudios opened this issue Sep 21, 2019 · 7 comments

Comments

@fivefishstudios
Copy link

Platformio Build works fine.
But I'm getting this error when trying to Upload to a Maxiduino board.

File "/Users/username/.platformio/packages/tool-kflash-kendryte210/kflash.py", line 13, in
import argparse
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/argparse.py", line 87, in
import re as _re
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 143, in
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
*** [upload] Error 1

This enum error only seems to affect when uploading to Sipeed/Kendryte boards.

PIO uploading to ESP8266 and ESP32 boards work fine. Only when uploading to Kendryte platform do I get this error.

@bitsk
Copy link
Member

bitsk commented Sep 25, 2019

Hi, @fivefishstudios

In order to make kflash run in python2, the enum module is placed in the kflash directory, which will be encountered in recent python3. You can open the kflash directory like this
C:\Users\{your user name}\.platformio\packages\tool-kflash-kendryte210
then delete the enum folder and test it again and it should be able to download successfully.

@fivefishstudios
Copy link
Author

Thank you so much! It's working now.

@dimitre
Copy link

dimitre commented Jan 28, 2020

I'm having a similar issue here

autechre:arduino-blink z$ pio run
Processing sipeed-maix-bit (platform: kendryte210; framework: arduino; board: sipeed-maix-bit)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Error in sitecustomize; set PYTHONVERBOSE for traceback:
AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last):
  File "/Users/z/.platformio/packages/tool-scons/script/scons", line 104, in <module>
    import pkg_resources
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 24, in <module>
    import re
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

And I didn't find this enum file to move or rename. any ideas?
Uploading Screen Shot 2020-01-28 at 01.27.13.png…

edit: now I can build everything after removing enum34 using command

sudo -H pip uninstall enum34

@valeros
Copy link
Contributor

valeros commented Jan 28, 2020

Hi @dimitre ! This issue should have been fixed already. Could you please upload to https://hastebin.com/ the contents of /Users/z/.platformio/packages/tool-scons/tool-kflash-kendryte210/kflash.py file?
Thanks!

@dimitre
Copy link

dimitre commented Jan 28, 2020

Now it is working here but this file is not present

ls -alF /Users/z/.platformio/packages/tool-scons/
total 1720
drwx------  16 z  staff     512 Jan 28 01:17 ./
drwxr-xr-x  12 z  staff     384 Jan 28 03:18 ../
-rwxr-xr-x   1 z  staff  238440 Aug  8 11:50 CHANGES.txt*
-rw-r--r--   1 z  staff    1071 Aug  8 11:50 LICENSE.txt
-rw-r--r--   1 z  staff    5795 Aug  8 11:50 MANIFEST
-rw-r--r--   1 z  staff     451 Aug  8 11:50 PKG-INFO
-rw-r--r--   1 z  staff    8266 Aug  8 11:50 README.txt
-rwxr-xr-x   1 z  staff    2620 Aug  8 11:50 RELEASE.txt*
drwxr-xr-x   3 z  staff      96 Jan 28 01:17 engine/
-rwxr-x---   1 z  staff     146 Aug 26 15:53 package.json*
-rw-r--r--   1 z  staff   26025 Aug  8 11:50 scons-time.1
-rw-r--r--   1 z  staff  535346 Aug  8 11:50 scons.1
-rw-r--r--   1 z  staff    5226 Aug  8 11:50 sconsign.1
drwxr-xr-x   7 z  staff     224 Jan 28 01:17 script/
-rw-r--r--   1 z  staff     127 Aug  8 11:50 setup.cfg
-rwxr-xr-x   1 z  staff   21793 Aug  8 11:50 setup.py*

@valeros
Copy link
Contributor

valeros commented Jan 28, 2020

@dimitre Sorry, that's my bad, I gave you a wrong path. Here is the correct one /Users/z/.platformio/packages/tool-kflash-kendryte210/kflash.py

@dimitre
Copy link

dimitre commented Jan 28, 2020

here
https://hastebin.com/gezacocupi.py
I removed all kflash installed through pip and pip3 and platformio installed it automagically after removing enum34

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

4 participants