Hello everyone.
I am a ‘complete’ newbie to Python having never learned or used it before.
I have donloaded Python 3.12.1 and use the IDLE Shell 3.12.1
I am following a YouTube course on using a BNO055 9-axis IMU by toptechboy where I now need to use Python and in Lessons 12 to 13 need to use vpython to create a visualisation.
Previously from the course I had Index errors but I read up on what that meant in Python and worked out a solution in my code to read the numerical string values coming in from the serial port which I am displaying perfectly.
import serial
import time
arduinoData=serial.Serial('com9',115200)
time.sleep(1)
pause = 0.0005
while (1==1):
while (arduinoData.inWaiting()==0):
pass
n= 6 #This is the 'size' of the Index Range which is 7 pieces of data
dataPacket=arduinoData.readline() #Here dataPacket reads the data on the Serial Port
dataPacket=str(dataPacket,'utf-8')
splitPacket=dataPacket.split(',') #Here splitPacket has the data Contents and creates an Arraytoptechboy imu lesson 13
while n < len (splitPacket):
Acal= float(splitPacket[0])
Gcal= float(splitPacket[1])
Mcal= float(splitPacket[2])
Scal= float(splitPacket[3])
Pitch= float(splitPacket[4])
Roll= float(splitPacket[5])
Yaw= float(splitPacket[6])
print("Acal=",Acal,"Gcal=",Gcal,"Mcal=",Mcal,"Scal",Scal, "Pitch=",Pitch,"Roll=",Roll,"Yaw=",Yaw)
time.sleep(pause)
n+=1
I followed the lesson instruction using: pip install vpython but the IDLE Shell returns this error:-
Traceback (most recent call last):
File “<pyshell#0>”, line 1, in
import vpython
ModuleNotFoundError: No module named ‘vpython’
When I used pip install vpython it informed me that it had successfully installed?
I ran the Repair Ensure all current features are correctly installed …
and now when I use at the Command Prompt pip install vpython it now say…
C:\Users\derek>pip install vpython
Fatal error in launcher: Unable to create process using ‘“c:\users\derek\appdata\local\programs\python\python37\python.exe” “C:\Users\derek\AppData\Local\Programs\Python\Python37\Scripts\pip.exe” install vpython’: The system cannot find the file specified.
Obviously I’ve broken something as well as having the original problem of vpython???
Any help and advice is warmly appreciated.