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

ImportError: cannot import name 'time_ns' #17

Closed
berthelemy opened this issue Sep 4, 2021 · 1 comment
Closed

ImportError: cannot import name 'time_ns' #17

berthelemy opened this issue Sep 4, 2021 · 1 comment

Comments

@berthelemy
Copy link

berthelemy commented Sep 4, 2021

Hi there,

Running Python 3.5.3 on Raspian "Stretch"

I get this error when running headlesspi.py:

ImportError: cannot import name 'time_ns'

Traceback:


File "headlesspi.py", line 10, in <module>
from utils import netlink
File "/home/pi/headlesspi/utils/netlink.py", line 5, in <module>
from time import time_ns

I replaced line 5 with import time, which took me further through the application.

But then I got another error (reporting separately)

@albedozero
Copy link
Collaborator

albedozero commented Sep 4, 2021

It sounds like you may be running the script from the command line with Python 2 instead of Python 3, and this code is Python3-specific. The command should be

python3 headlesspi.py

Let me know if that still doesn't work!

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

2 participants