ev3dev / vscode-ev3dev-browser

Visual Studio Code extension for browsing ev3dev devices
https://marketplace.visualstudio.com/items?itemName=ev3dev.ev3dev-browser
MIT License
36 stars 11 forks source link

Ev3 Python "No module named 'pybricks'" #114

Closed ChefVyn closed 2 years ago

ChefVyn commented 2 years ago

Describe the bug Hello i am starting with Ev3 recently but i have been running into a problem

Traceback (most recent call last):
  File "/home/robot/getting_started/main.py", line 2, in <module>
    from pybricks.hubs import EV3Brick
ImportError: No module named 'pybricks'
----------
Exited with error code 1.

Does anyone know what the problem is?

I have imported pybricks already and i am using python 3.9.1 Ev3python

dlech commented 2 years ago

You need to change the shebang to #!/usr/bin/env pybricks-micropython.

ChefVyn commented 2 years ago

Ty that fixed it but now its giving me thi error2 s

dlech commented 2 years ago

The file needs the executable permission bits set. This should happen automatically. If it doesn't, it usually means there is a blank line, spaces or hidden characters before the shebang. The #! has to be absolutely the first thing in the file.

ChefVyn commented 2 years ago

There is nothing in front

error2 t

dlech commented 2 years ago

Sorry, I made a typo, it needs to be #!/usr/bin/env pybricks-micropython.

ChefVyn commented 2 years ago

TY! that was the problem