error: --plat-name must be one of (‘win32‘, ‘win-amd64‘, ‘win-arm32‘, ‘win-arm64‘)

在MSYS2中,虚拟环境里安装pycairo时,报错如下:

...

buiding 'cairo._cairo' extension ...

error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')

复现步骤:

pacman -Sy
pacman -S python
mkdir myproject
cd myproject
python -m venv venv
source venv/bin/activate
pip install pycairo

解决:创建虚拟环境时带上系统包

python -m venv venv --system-site-packages

你可能感兴趣的:(前端,linux,javascript)