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

Error running EV3-Touch.py "ImportError: No module named builtins" #78

Open
fantauzzi opened this issue Nov 25, 2016 · 8 comments
Open

Comments

@fantauzzi
Copy link

cd to directory BrickPi_Python/Sensor_Examples and run

} sudo python EV3-Touch.py
Traceback (most recent call last):
  File "EV3-Touch.py", line 24, in <module>
    from BrickPi import *   							#import BrickPi.py file to use BrickPi operations
  File "/home/pi/workspace/BrickPi_Python-master/Sensor_Examples/BrickPi.py", line 47, in <module>
    from builtins import input
ImportError: No module named builtins

Output of uname -a is

} uname -a
Linux dex 4.4.32-v7+ #924 SMP Tue Nov 15 18:11:28 GMT 2016 armv7l GNU/Linux
@CleoQc
Copy link
Member

CleoQc commented Nov 25, 2016

Hi. You need to run
sudo pip install -U future
in a terminal to add the library in question. It's added already for our Raspbian for Robots so I'm assuming you're running your own OS.

@fantauzzi
Copy link
Author

Hi! I am running the Raspbian for Robots downloaded from here:
https://drive.google.com/file/d/0B0WChwP4CnLBV2R6VE8yeFF2ZFU/view?usp=sharing
as per instructions reported here:
https://www.dexterindustries.com/howto/install-raspbian-for-robots-image-on-an-sd-card/
I have just re-imaged the micro SD with it, it is a fresh install.
Here the output of uname -a

Linux dex 4.4.32-v7+ #924 SMP Tue Nov 15 18:11:28 GMT 2016 armv7l GNU/Linux

Should I use a different image instead?

@CleoQc
Copy link
Member

CleoQc commented Nov 25, 2016

You're doing every thing right. The issue is that this is a recent change. Our apologies.
Did you pull down the repo directly from Github? In short, you seem to be out of sync. If you go through DI Update, you would be getting the latest BrickPi code and the library import that is now required.
Or you can just enter
sudo pip install -U future
in a command prompt to get the missing library.

@CleoQc
Copy link
Member

CleoQc commented Nov 25, 2016

And thank you for bringing this to our attention. There's now a PR that will take care of this for others .
#79

@fantauzzi
Copy link
Author

I downloaded the repo from github as a zip file.
sudo pip install -U future resolved the issue. Thanks!

@CleoQc
Copy link
Member

CleoQc commented Nov 25, 2016

Great!!!
Just to be safe, you also need to run
python setup.py install
if you haven't already done so.

@fantauzzi
Copy link
Author

In the output of pip I see BrickPy is already installed. Do I need to run python setup.py install nevertheless?

} pip list | grep BrickPi
BrickPi (0.0.0)

@CleoQc
Copy link
Member

CleoQc commented Nov 25, 2016

Since your base is Raspbian for Robots, and it's the latest version, you're most likely set and don't need to run it. Apologies again for this hiccup you faced.

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