When I run python program from another folder with python /home/pi/test/test.py it returns error as it couldn't load opencv. But when I changed to program folder then it runs smoothly.
What is the file path that you are executing from?
Prefixing a path with "/" starts from the root directory. If it is in the "home" folder, try using "home/pi/test/test.py".
You could also use an absolute file path including the drive. example: "C:\Documents\Newsletters\Summer2018.pdf"
https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.