Darren
Darren

Reputation: 41

EV3: How to import ev3dev for Python

I am attempting to program my Mindstorms EV3 using Python and have installed ev3dev Brickman to my EV3 on a microSD card. I am using a Macbook Pro (OS X 10.11.6) and Python 3.5.1 however when I attempt to perform the from ev3dev.ev3 import * it responds with "No module named ev3dev.ev3".

If I run the setup.py module in the ev3dev-lang-python-develop repo folder, then I get an error associated with the version number, thus:

*raise ValueError("Cannot find the version number!")
ValueError: Cannot find the version number!*

Having followed the EV3DEV installation notes (https://github.com/rhempel/ev3dev-lang-python), which indicate that the ev3dev library is included out-of-the-box. I'm wondering if I'm missing a step somewhere in order to get my python EV3 scripts to run?

Thanks.

Upvotes: 2

Views: 2613

Answers (1)

Oreste Riccardo Natale
Oreste Riccardo Natale

Reputation: 137

I generally simply use the import statement as follows:

from ev3dev import ev3 as ev3

Remember that you have to install the ev3dev library also on your Mac if you want to test the scripts locally before downloading to the ev3 brick. In this case of course you will eventually get exceptions if you try to access devices like motors or sensors on your Mac.

Upvotes: 1

Related Questions