Skip to content

AttributeError: module 'time' has no attribute 'time_ns' #8877

Closed
@denis-stepanov

Description

@denis-stepanov

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • [ x] I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP-01
  • Core Version: 3.1.1
  • Development Env: Arduino IDE
  • Operating System: Ubuntu

Settings in IDE

  • Module: Generic ESP8266 Module
  • Flash Mode: dio
  • Flash Size: 1MB
  • lwip Variant: v2 Lower Memory
  • Reset Method: nodemcu
  • Flash Frequency: 40Mhz
  • CPU Frequency: 80Mhz
  • Upload Using: SERIAL
  • Upload Speed: 115200

Problem Description

I have a problem compiling any sketch with the release 3.1.1. The last working one was 3.0.2.

Using board 'generic' from platform in folder: /home/dns/.arduino15/packages/esp8266/hardware/esp8266/3.1.1
Using core 'esp8266' from platform in folder: /home/dns/.arduino15/packages/esp8266/hardware/esp8266/3.1.1
/home/dns/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I /home/dns/.arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/mkbuildoptglobals.py /home/dns/arduino-1.8.19 10819 /tmp/arduino_build_46880 /tmp/arduino_build_46880/core/build.opt /home/dns/arduino-1.8.19/examples/01.Basics/BareMinimum/BareMinimum.ino.globals.h /home/dns/.arduino15/packages/esp8266/hardware/esp8266/3.1.1/cores/esp8266/CommonHFile.h
Traceback (most recent call last):
  File "/home/dns/.arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/mkbuildoptglobals.py", line 846, in <module>
    sys.exit(main())
  File "/home/dns/.arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/mkbuildoptglobals.py", line 759, in main
    if time.time_ns() < os.stat(commonhfile_fqfn).st_mtime_ns:
AttributeError: module 'time' has no attribute 'time_ns'
exit status 1
Error compiling for board Generic ESP8266 Module.

I saw that a similar error #8803 was merged in 3.1.1, but I still have it.

$ cat /etc/issue
Ubuntu 18.04.6 LTS \n \l
$ python --version
Python 2.7.17
$ python3 --version
Python 3.6.9

Let me know if you need any other info.

MCVE Sketch

BareMinimum from Arduino IDE examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions