windows10自帶ubuntu安裝配置,安裝圖形化界面,cv2.imshow() ,unable to open display,xmanager圖形不顯示問題


參考:https://blog.csdn.net/fairydetail/article/details/82345010

換成清華源 https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

 

使用root登錄,設置root密碼   https://blog.csdn.net/qq_29384639/article/details/87178025      

1、使用普通用戶登錄

2、sudo passwd root

3、輸入普通用戶密碼,在輸入兩次新密碼

4、su root

5、輸入新設置密碼

 

使用ssh工具連接ubuntu    https://blog.csdn.net/sinat_33784741/article/details/83865490      windows磁盤目錄在   /mnt下

xshell 無法登錄root賬號     https://blog.csdn.net/qq_35445306/article/details/78771398     

  1. 修改 /etc/ssh/sshd_config 文件把PermitRootLogin Prohibit-password 添加#注釋掉

  2. 新添加:PermitRootLogin yes

  3. 重啟ssh服務 /etc/init.d/ssh restart

  4. 重新使用root連接,ok

 

windows下的ubuntu重啟, 遇到一下錯誤,             用   sudo killall -r '.*' && exit   重啟

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.

 

 

 

 

root登錄      su  進入root        輸入密碼

下載opencv,使用pip3 install opencv-python,      python3.6使用的opencv 4.1.1.26      opencv版本地址 https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/opencv-python/

cv2.imshow()     linux下執行xhost命令報錯:unable to open display

解決辦法:   

export DISPLAY=:0.0

xhost +

 

使用xshell  cv2.imshow的時候,彈框X11使用xmanager打開,  下載了xmanager后,還是打不開

解決辦法:xmanager-passive  屬性里設置窗口模式為多個窗口模式,點設置,窗口管理器為自動切換

2也可以使用 xLaunch,配置為 Mutiple windows

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM