在mac中的安装PyUserInput(亲测有效)

PyUserInput 在不同系统下的安装需要使用不同的依赖:

  • Linux - Xlib (python-xlib)
  • Mac - Quartz, AppKit
  • Windows - pywin32, pyHook

1 安装Quartz依赖

安装命令:

pip install quartz

如果以上命令可以正常安装,则跳过以下步骤,如报错:

 1.1 下载quartz-0.0.1.dev0.tar.gz安装包:

下载地址:

https://pypi.tuna.tsinghua.edu.cn/packages/31/f2/4fac785ec7690dd2b9f87506aa52e702ed5d98dedc06a2e940c4a076136a/quartz-0.0.1.dev0.tar.gz

tips:以上下载地址是修改pip镜像为清华源后出现的😄

修改pip镜像为清华源步骤:

# pip环境更换
# pip若版本过低时,无法查看conf
pip3 install -U pip -i https://pypi.tuna.tsinghua.edu.cn/simple

# 创建文件夹
mkdir ~/.pip
# 创建配置文件
cd ~/.pip && touch pip.conf
# 写入
vim pip.conf

# 写入内容
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn


# 查看pip3源
pip3 config list
# or
pip config list

按上述修改pip镜像后再安装依赖quartz则出现quartz-0.0.1.dev0.tar.gz安装包下载地址:

1.2 解压quartz-0.0.1.dev0.tar.gz并修改setup.py

1)解压quartz-0.0.1.dev0.tar.gz

2)quartz-0.0.1.dev0文件夹内setup.py文件如下

 找到以下行并修改:

install_requires=read_dependencies(“requirements.txt")
将其修改为:
install_requires=read_dependencies("quartz.egg-info/requires.txt")

1.3 quartz安装

回到quartz-0.0.1.dev0文件的父级目录,运行以下:

pip install -e quartz-0.0.1.dev0



完成标识: 


 

2 安装AppKit依赖

在这里插入图片描述

安装过程中发现,PyUserInput所需的依赖库不叫AppKit这个名字,所以不是用pip install AppKit安装!

安装命令:

sudo pip install --upgrade --force-reinstall PyObjC PyObjC-core

完成标识: 

3 安装PyUserInput

安装命令:

pip install PyUserInput

完成标识: 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值