Gemäß gibt es 2 Optionen:
- Option 1: Mac OS X binary "PySide" siehe Link [2]
- Option 2: den Befehl "brew install pyqt", siehe Link [1]
Wenn ich das Mac OS X binary installieren möchte, kriege ich die Fehlermeldung, dass mein Betriebssystem zu aktuell dafür ist.
Option 2:
Ich probierte es mit
Code: Alles auswählen
brew install pyqt
Ich erhalte aber weiter die Fehlermeldung:
Code: Alles auswählen
Laptop:Anwendung_Python myname$ python3 __init__.py
Traceback (most recent call last):
File "__init__.py", line 5, in <module>
from PyQt5 import QtCore, QtGui, QtWidgets
ModuleNotFoundError: No module named 'PyQt5'
MacOS Catalina, version 10.15.1
Python 2.7.16
Python 3.8.1
______________________________________
P.S.
[1]
https://pythonbasics.org/install-pyqt/
[2]
https://wiki.qt.io/PySide_Binaries_MacOSX
[3] Ein Auszug der Ausgabe im Terminal nach "brew install pyqt":
Code: Alles auswählen
==> Installing dependencies for pyqt: openssl@1.1, readline, sqlite, xz, python@3.8, qt and sip
==> Installing pyqt dependency: openssl@1.1
==> Downloading https://homebrew.bintray.com/bottles/openssl@1.1-1.1.1g.catalina
==> Downloading from https://akamai.bintray.com/19/1926679569c6af5337de812d86f4d
######################################################################## 100.0%
==> Pouring openssl@1.1-1.1.1g.catalina.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@1.1/certs
and run
/usr/local/opt/openssl@1.1/bin/c_rehash
openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have openssl@1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile
For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
==> Summary
🍺 /usr/local/Cellar/openssl@1.1/1.1.1g: 8,059 files, 18MB
==> Installing pyqt dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/readline-8.0.4.catalina.bot
==> Downloading from https://akamai.bintray.com/6a/6ae1c8e7c783f32bd22c6085caa4d
######################################################################## 100.0%
==> Pouring readline-8.0.4.catalina.bottle.tar.gz
==> Caveats
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
==> Summary
🍺 /usr/local/Cellar/readline/8.0.4: 48 files, 1.5MB
==> Installing pyqt dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.31.1.catalina.bott
==> Downloading from https://akamai.bintray.com/e0/e09e8c96db88178e4f47b0cdab647
######################################################################## 100.0%
==> Pouring sqlite-3.31.1.catalina.bottle.tar.gz
==> Caveats
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile
For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
==> Summary
🍺 /usr/local/Cellar/sqlite/3.31.1: 11 files, 4MB
==> Installing pyqt dependency: xz
==> Downloading https://homebrew.bintray.com/bottles/xz-5.2.5.catalina.bottle.ta
==> Downloading from https://akamai.bintray.com/2d/2dcc8e0121c934d1e34ffdb37fcd7
######################################################################## 100.0%
==> Pouring xz-5.2.5.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/xz/5.2.5: 92 files, 1.1MB
==> Installing pyqt dependency: python@3.8
==> Downloading https://homebrew.bintray.com/bottles/python@3.8-3.8.2.catalina.b
==> Downloading from https://akamai.bintray.com/4b/4bd9406b5d69313fcef3e572f8539
######################################################################## 100.0%
==> Pouring python@3.8-3.8.2.catalina.bottle.tar.gz
==> /usr/local/Cellar/python@3.8/3.8.2/bin/python3 -s setup.py --no-user-cfg ins
==> /usr/local/Cellar/python@3.8/3.8.2/bin/python3 -s setup.py --no-user-cfg ins
==> /usr/local/Cellar/python@3.8/3.8.2/bin/python3 -s setup.py --no-user-cfg ins
==> Caveats
Python has been installed as
/usr/local/opt/python@3.8/bin/python3
You can install Python packages with
/usr/local/opt/python@3.8/bin/pip3 install <package>
They will install into the site-package directory
/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
python@3.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have python@3.8 first in your PATH run:
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.bash_profile
For compilers to find python@3.8 you may need to set:
export LDFLAGS="-L/usr/local/opt/python@3.8/lib"
==> Summary
🍺 /usr/local/Cellar/python@3.8/3.8.2: 4,124 files, 63MB
==> Installing pyqt dependency: qt
==> Downloading https://homebrew.bintray.com/bottles/qt-5.14.2.catalina.bottle.t
==> Downloading from https://akamai.bintray.com/23/235bbe918f05509380ba870b24a84
######################################################################## 100.0%
==> Pouring qt-5.14.2.catalina.bottle.tar.gz
==> Caveats
We agreed to the Qt open source license for you.
If this is unacceptable you should uninstall.
qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.
If you need to have qt first in your PATH run:
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile
For compilers to find qt you may need to set:
export LDFLAGS="-L/usr/local/opt/qt/lib"
export CPPFLAGS="-I/usr/local/opt/qt/include"
==> Summary
🍺 /usr/local/Cellar/qt/5.14.2: 10,429 files, 362.5MB
==> Installing pyqt dependency: sip
==> Downloading https://homebrew.bintray.com/bottles/sip-4.19.22.catalina.bottle
==> Downloading from https://akamai.bintray.com/04/0459d670cc68cb4a4388b82fa2c73
######################################################################## 100.0%
==> Pouring sip-4.19.22.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/sip/4.19.22: 15 files, 973.2KB
==> Installing pyqt
==> Downloading https://homebrew.bintray.com/bottles/pyqt-5.14.2.catalina.bottle
==> Downloading from https://akamai.bintray.com/4f/4fc5664001beb9e1d001862656a3d
######################################################################## 100.0%
==> Pouring pyqt-5.14.2.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/pyqt/5.14.2: 910 files, 26.1MB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /usr/local/Cellar/openssl@1.1/1.1.1d... (7,983 files, 17.9MB)
Removing: /Users/myname/Library/Caches/Homebrew/openssl@1.1--1.1.1d.catalina.bottle.tar.gz... (5.2MB)
Removing: /Users/myname/Library/Caches/Homebrew/python--3.7.6_1.catalina.bottle.tar.gz... (14.8MB)
Removing: /usr/local/Cellar/readline/8.0.1... (48 files, 1.5MB)
Removing: /Users/myname/Library/Caches/Homebrew/readline--8.0.1.catalina.bottle.tar.gz... (517.3KB)
Removing: /usr/local/Cellar/sqlite/3.30.1... (11 files, 3.9MB)
Removing: /Users/myname/Library/Caches/Homebrew/sqlite--3.30.1.catalina.bottle.tar.gz... (1.9MB)
Removing: /usr/local/Cellar/xz/5.2.4... (92 files, 1MB)
Removing: /Users/myname/Library/Caches/Homebrew/xz--5.2.4.catalina.bottle.tar.gz... (373.9KB)
Removing: /Users/myname/Library/Logs/Homebrew/gdbm... (64B)
Removing: /Users/myname/Library/Logs/Homebrew/python... (3 files, 141.7KB)
Removing: /Users/myname/Library/Logs/Homebrew/readline... (64B)
Removing: /Users/myname/Library/Logs/Homebrew/sqlite... (64B)
Removing: /Users/myname/Library/Logs/Homebrew/xz... (64B)
Removing: /Users/myname/Library/Logs/Homebrew/openssl@1.1... (64B)
Pruned 0 symbolic links and 4 directories from /usr/local
==> Caveats
==> openssl@1.1
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@1.1/certs
and run
/usr/local/opt/openssl@1.1/bin/c_rehash
openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have openssl@1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile
For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
==> readline
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
==> sqlite
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile
For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
==> python@3.8
Python has been installed as
/usr/local/opt/python@3.8/bin/python3
You can install Python packages with
/usr/local/opt/python@3.8/bin/pip3 install <package>
They will install into the site-package directory
/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
python@3.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have python@3.8 first in your PATH run:
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.bash_profile
For compilers to find python@3.8 you may need to set:
export LDFLAGS="-L/usr/local/opt/python@3.8/lib"
==> qt
We agreed to the Qt open source license for you.
If this is unacceptable you should uninstall.
qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.
If you need to have qt first in your PATH run:
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile
For compilers to find qt you may need to set:
export LDFLAGS="-L/usr/local/opt/qt/lib"
export CPPFLAGS="-I/usr/local/opt/qt/include"