Frequently-Asked Questions

Q: Why does my Python program exit quickly or immediately throw an error?

A: This may occur if your file includes Windows-style line endings (CRLF–carriage-return line-feed), which are often inserted by editors on Windows. To resolve this issue, open an SSH session and run the following command, replacing <file> with the name of the Python file you’re using:

sed -i 's/\r//g' <file>

This will fix it for the copy of the file on the brick, but if you plan to edit it again from Windows, you should configure your editor to use Unix-style line endings (LF–line-feed). For PyCharm, you can find a guide on doing this here. Most other editors have similar options; there may be an option for it in the status bar at the bottom of the window or in the menu bar at the top.

Q: Where can I learn more about the ev3dev operating system?
A: is a great resource for finding guides and tutorials on using ev3dev, straight from the maintainers.
Q: How can I request support on the ev3dev2 Python library?
A: If you are having trouble using this library, please open an issue at our Issues tracker so that we can help you. When opening an issue, make sure to include as much information as possible about what you are trying to do and what you have tried. The issue template is in place to guide you through this process.
Q: How can I upgrade the library on my EV3?

A: You can upgrade this library from an Internet-connected EV3 with an SSH shell as follows. Make sure to type the password (the default is maker) when prompted.

sudo apt-get update
sudo apt-get install --only-upgrade python3-ev3dev2 micropython-ev3dev2
Q: Are there other useful Python modules to use on the EV3?
A: The Python language has a package repository where you can find libraries that others have written, including the latest version of this package.
Q: What compatibility issues are there with the different versions of Python?
A: Some versions of the ev3dev distribution come with Python 2.x, Python 3.x, and micropython installed, but this library is compatible only with Python 3 and micropython.