麒麟系统安装pyautogui

一.安装pip3

1.直接在terminal中输入python,得到的版本是2.7.12,说明python2.7.12是当前系统默认,[优先级]高于python3.8.2,因为要用python3,所以需要将python3.8设置为默认。

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

2、python3.8.2安装pip

# 安装pip3
sudo apt-get install python3-pip
# 更新pip3,更新至最新版本的pip3
sudo pip3 install --upgrade pip
# 卸载pip3,安装pip这个指令就不要用了,只是顺便提一下
sudo apt-get remove python3-pip

二.安装pyautogui

sudo apt-get scrot
sudo apt-get install python-tk
pip3 install pyautogui
sudo apt-get install python3-tk python3-dev

三.查看

gm@TV-GM1000-wuy3:~/桌面$ python
Python 3.8.2 (default, May 10 2021, 05:51:26) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyautogui
>>> print(pyautogui.size())
Size(width=1920, height=1080)

你可能感兴趣的:(麒麟系统安装pyautogui)