question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run other modules with ev3dev

See original GitHub issue
  • ev3dev version: 4.14.117-ev3dev-2.3.5-ev3
  • ev3dev-lang-python version:
ii  micropython-ev 2.1.0        all          Python language bindings for ev3d
ii  python3-ev3dev 1.2.0        all          Python language bindings for ev3d
ii  python3-ev3dev 2.1.0        all          Python language bindings for ev3d

I am trying to install other modules as PyAutoGUI on the ev3 machine and it doesnt work. I made a virtual environment following the steps at the bottom of this page https://github.com/ev3dev/vscode-hello-python. It worked well. I installed the module using “pip install pyautogui”. The module successfully installed. Unfortunately, when i run the program using f5 (after i configured my new venv folder as my python interpreter) the script doesnt recognize the module and outputs the following error:

Traceback (most recent call last):
  File "/home/robot/EV3/start.py", line 9, in <module>
    import PyAutoGUI
ImportError: No module named 'PyAutoGUI'
>>> & c:/Users/Alex/Desktop/Programare/EV3/.venv/Scripts/Activate.ps1
  File "<stdin>", line 1
    & c:/Users/Alex/Desktop/Programare/EV3/.venv/Scripts/Activate.ps1
    ^
SyntaxError: invalid syntax

The code i am using:

#!/usr/bin/env python3

from time import sleep

from ev3dev2.motor import LargeMotor, OUTPUT_A, OUTPUT_B, SpeedPercent, MoveTank
from ev3dev2.sensor import INPUT_1
from ev3dev2.sensor.lego import TouchSensor
from ev3dev2.led import Leds
import PyAutoGUI

while True:
    print(PyAutoGUI.position())

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
GrecuAlexandrucommented, Oct 1, 2020

Nevermind, I made it work using the following link: https://ev3dev-lang.readthedocs.io/projects/python-ev3dev/en/ev3dev-jessie/rpyc.html Thanks again for your help!

1reaction
dlechcommented, Sep 30, 2020
$ dpkg -s python3-rpyc
Package: python3-rpyc
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 269
Maintainer: Denis Demidov <dennis.demidov@gmail.com>
Architecture: all
Source: rpyc
Version: 3.3-1
Depends: python3, python3-plumbum, python3:any (>= 3.3.2-2~)
Description: RPyC (Remote Python Call).
 A transparent and symmetric RPC library for python.
Homepage: http://rpyc.readthedocs.io

Looks like v3.3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python-ev3dev 2.1.0.post1 documentation
It allows you to run this program from Brickman, the graphical menu that you see on the device screen. The other lines are...
Read more >
loading 3rd party library · Issue #1294 · ev3dev ...
I have tried to load 3rd party lib to implement MQTT message publishing while running the EV3 Scripts. import sys ...
Read more >
Creating and running programs — ev3-micropython 2.0.0 ...
Figure 8 A project contains a program called main.py and optional resources like sounds or MicroPython modules. Creating a new project¶. To create...
Read more >
ev3dev Home
ev3dev is a Debian Linux-based operating system that runs on several LEGO MINDSTORMS compatible platforms including the LEGO MINDSTORMS EV3 and Raspberry ...
Read more >
python-ev3dev Documentation
import from individual modules for things like sensors and motors ... run-forever will cause the motor to run until another command is sent....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found