I am running python3.5 on a RPi3 and have installed matplotlib and numpy. I can import when in the shell, but not from within the terminal, per below:
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "copyright", "credits" or "license()" for more information.
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>>
.
pi@raspberrypi:~ $ python3 -V
Python 3.5.3
pi@raspberrypi:~ $ import numpy as np
bash: import: command not found
pi@raspberrypi:~ $ import numpy
bash: import: command not found
pi@raspberrypi:~ $ import matplotlib.pyplot as plt
bash: import: command not found
pi@raspberrypi:~ $
Any ideas on why this would be the case?
python3 -Vruns once to print the version then exits. Usepython3with no special flags to get an interpreter shell. Or code your python stuff in a file withnano myprog.pythen run it withpython3 myprog.py.