Programming/python(파이썬)
docker를 이용하여 python 에서 opencv 돌리기
구차니
2024. 5. 8. 10:26
python 실행하기 위한 명령어 줄, 물론 pip 로 패키지도 없어서 그냥 깡통 python 상태
$ docker run --rm -it python python |
[링크 : https://seorenn.github.io/note/docker-development-environment.html]
docker 로 장치연결해주기
docker run -ti -v /tmp/.X11-unix/:/tmp/.X11-unix --env QT_X11_NO_MITSHM=1 --device=/dev/video0:/dev/video0 -e DISPLAY=$DISPLAY --name test pytorch/pytorch:1.12.1-cuda11.3-cudnn8-devel /bin/bash |
[링크 : https://shuka.tistory.com/68]
[링크 : https://blog.naver.com/cheeryun/222383212241]
$ docker run --rm -it python bash # pip install opencv-python |
[링크 : https://pypi.org/project/opencv-python/]
아래는 테스트 필요 + docker 내에서 해야하나 찾아보는 중
$ sudo apt install libgl1-mesa-glx libglib2.0-0 |
wayland 예제 검색..
$ docker run -e XDG_RUNTIME_DIR=/tmp \ -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \ --user=$(id -u):$(id -g) \ imagename waylandapplication |
[링크 : https://unix.stackexchange.com/questions/330366/]
ubuntu 22.04 인데 안된다. ㅠㅠ
Qt 쪽 변수를 넘겨줘야 하나?
>>> cv2.imshow("test",a) qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.12/site-packages/cv2/qt/plugins" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: xcb. Aborted (core dumped) |
패키지 깐다고 해결되면 행복은 하겠는데...
pip install PyQt5 |