pi@model-t: $ sudo apt-get install libhdf5-dev -y && sudo apt-get install libhdf5-serial-dev -y && sudo apt-get install libatlas-base-dev -y && sudo apt-get install libjasper-dev -y && sudo apt-get install libqtgui4 -y && sudo apt-get install libqt4-test -y
pi@model-t: $ pip3 install opencv-python
pi@model-t: $ pip3 install matplotlib
pi@model-t:~/projects/SunFounder_PiCar-V/remote_control $ python3
Python 3.7.3 (default, Apr 3 2019, 05:39:12)[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/.local/lib/python3.7/site-packages/cv2/__init__.py", line 3, in <module>
from .cv2 import *
ImportError: /home/pi/.local/lib/python3.7/site-packages/cv2/cv2.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: __atomic_fetch_add_8
>>>
pi@model-t:~/projects/SunFounder_PiCar-V/remote_control $ LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1.2.0 python3
Python 3.7.3 (default, Apr 3 2019, 05:39:12)[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>>
>>> import cv2
>>>
To make this simpler, here is some config I’ve added in the pi’s ~/.bashrc:
1
2
3
4
# For errors repoprted while installing tensorflow
PATH=$PATH:/home/pi/.local/bin
# For errors while using cv2 under python3
LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1.2.0
When remotely viewing the pi’s screen through VNC, the following lines may be needed to set the proper resolution in the pi’s /boot/config.txt:
1
2
3
4
5
# Uncomment and update, for VNC viewer screen resolutionframebuffer_width=2560framebuffer_height=1440# If above doesn't work, also comment the line below#dtoverlay=vc4-fkms-v3d
>>> import tensorflow
2019-12-10 18:51:26.217429: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory
python3 -c 'import tensorflow as tf; print(tf.__version__)'
1.14.0
However, I also ran into the following error
Error ModuleNotFoundError: No module named '_edgetpu_cpp_wrapper'.
cd /usr/local/lib/python3.7/dist-packages/edgetpu/swig/
sudo cp _edgetpu_cpp_wrapper.cpython-35m-arm-linux-gnueabihf.so _edgetpu_cpp_wrapper.cpython-37m-arm-linux-gnueabihf.so
Some errors while trying to manually steer the PiCar may happen, with something like the following line
1
picar.Servo.Servo(1)
1
2
3
4
5
File "/usr/local/lib/python3.7/dist-packages/SunFounder_PiCar-1.0.1-py3.7.egg/picar/SunFounder_PCA9685/Servo.py", line 36, in __init__
self.pwm = PCA9685.PWM(bus_number=bus_number, address=address)
File "/usr/local/lib/python3.7/dist-packages/SunFounder_PiCar-1.0.1-py3.7.egg/picar/SunFounder_PCA9685/PCA9685.py", line 47, in __init__
self.bus = smbus.SMBus(self.bus_number)
TypeError: an integer is required (got type NoneType)