After brew install pyqt
, you can brew test pyqt
which will use the python you have got in your PATH in oder to do the test (show a Qt window).
For non-brewed Python, you'll have to set your PYTHONPATH as brew info pyqt
will tell.
Sometimes it is necessary to open a new shell or tap in order to use the freshly brewed binaries.
I frequently check these issues by printing the sys.path from inside of python:
python -c "import sys; print(sys.path)"
The $(brew --prefix)/lib/pythonX.Y/site-packages
have to be in the sys.path
in order to be able to import stuff. As said, for brewed python, this is default but for any other python, you will have to set the PYTHONPATH
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…