简体   繁体   English

macOS Sierra 为 python2.7 安装 PyQt5

[英]macOS Sierra install PyQt5 for python2.7

I'm trying desperately to install PyQt5 for python2.7 on my Mac running macOS Sierra.我正在拼命尝试在运行 macOS Sierra 的 Mac 上为 python2.7 安装 PyQt5。 I've tried running:我试过运行:

brew install pyqt5

As well as downloading the source code and compiling myself.以及下载源代码并自己编译。 Can anybody provide me with some quick commands that I can copy/paste into terminal to install PyQt5 for python2.7?任何人都可以向我提供一些快速命令,我可以将这些命令复制/粘贴到终端以安装适用于 python2.7 的 PyQt5 吗?

This is a pretty good rundown of the problem, and a solution:这是问题的一个很好的纲要,以及一个解决方案:

https://plashless.wordpress.com/2014/03/26/building-pyqt5-for-python2-7-on-a-clean-ubuntu-13-10-build-machine/ https://plashless.wordpress.com/2014/03/26/building-pyqt5-for-python2-7-on-a-clean-ubuntu-13-10-build-machine/

I suppose you don't see using python3 as an option.我想你没有看到使用 python3 作为选项。 Even within a virtualenv?即使在虚拟环境中? Developing new software using python2 may become increasingly frustrating (more and more problems like the one you're encountering).使用 python2 开发新软件可能会变得越来越令人沮丧(像您遇到的问题越来越多)。

sudo easy_install pip
sudo pip install virtualenv
brew install python3
virtualenv -p python3 venv
. venv/bin/activate
pip install pyqt5
# PROFIT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM