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

/usr/bin/env: 'pybricks-micropython': No such file or directory #92

Closed AhmyOhlin closed 4 years ago

AhmyOhlin commented 4 years ago

Hi There,

could someone help me to fix this problem?

I tried all the suggested solutions out there. It doesn't work properly.

This is the Code:

#!/usr/bin/env pybricks-micropython
from pybricks import ev3brick as brick
from pybricks.ev3devices import Motor
from pybricks.parameters import Port

# Play a sound.
brick.sound.beep()

# Initialize a motor at port B.
test_motor = Motor(Port.B)

# Run the motor up to 500 degrees per second. To a target angle of 90 degrees.
test_motor.run_target(500, 90)

# Play another beep sound.
# This time with a higher pitch (1000 Hz) and longer duration (500 ms).
brick.sound.beep(1000, 500)

This is the error:

Starting: brickrun --directory="/home/robot/simple" "/home/robot/simple/main.py"
Started.
----------
/usr/bin/env: 'pybricks-micropython': No such file or directory
----------
Exited with error code 127.
dlech commented 4 years ago

Did you use the SD card image from LEGO Education?

Ev3Dev-Brix commented 4 years ago

I'm having a similar issues, my code, code is been commented out but I believe my problem is with the #!/usr/bin/env pybricks-micropython#

#!/usr/bin/env pybricks-micropython
from pybricks import ev3brick as brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
                                 InfraredSensor, UltrasonicSensor, GyroSensor)
from pybricks.parameters import (Port, Stop, Direction, Button, Color,
                                 SoundFile, ImageFile, Align)
from pybricks.tools import print, wait, StopWatch
from pybricks.robotics import DriveBase
brick.sound.beep()
 #Initialize a motor at port B.
test_motor = Motor (Port.B) 
#Run the Motor up to 500 degrees per second to a target of 90 degrees.
#then go in the opposite direction for one rotation 360 degrees
Print ("Motor Test Start")
#test_motor.run_target(500, 90)
#dtest_motor.run_target(-500,360)
#Play another beep sound. 
#This time with a higer ptich (1000 Hz) and longer duration (500ms)
brick.sound.beep(1000,500)
Print ("Motor Test End")

and the output as I attempt to debug:

Starting: brickrun --directory="/home/robot/First_EV3_Program" "/home/robot/First_EV3_Program/MotorTestv1f.py"
Started.
----------
Traceback (most recent call last):
  File "/home/robot/First_EV3_Program/MotorTestv1f.py", line 15, in <module>
NameError: name 'Print' is not defined

I'm fairly new to this and attempting to get this up and running for my son, so he can take over

dlech commented 4 years ago

names in python are case-sensitive, so it is telling you that Print is not defined.

This should work:

print("Motor Test Start")
Ev3Dev-Brix commented 4 years ago

Thank you, I should know better, my humble thank you.

On January 25, 2020 at 1:01 AM David Lechner notifications@github.com wrote:

names in python are case-sensitive, so it is telling you that Print is not defined.

This should work:

print("Motor Test Start")

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/ev3dev/vscode-ev3dev-browser/issues/92?email_source=notifications&email_token=AOJIR3OASY32ZVG4QAHAYFLQ7PITPA5CNFSM4KEY37CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ4WETQ#issuecomment-578380366 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJIR3NGNR6SNWASU2HGK3TQ7PITPANCNFSM4KEY37CA .