问题
I would like to play with QtMultimedia
of PyQt5
but this does not work.
> conda list pyqt
# packages in environment at /anaconda3:
#
# Name Version Build Channel
pyqt 5.9.2 py37h655552a_2
> python
Python 3.7.0 (default, Jun 28 2018, 07:39:16)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda custom (64-bit) on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5.QtMultimedia
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt5.QtMultimedia'
This looks like a bug.
Something strange : I have a file /anaconda3/lib/python3.7/site-packages/PyQt5/QtMultimediaWidgets.pyi
which imports QtMultimedia
but no QtMultimedia.pyi
.
Can I easily fix this and what is the best way to report this bug ?
回答1:
Use:
pip3 install pyqt5 --user
There is probably a conda equivalent, but this works for me in a conda environment without any problems. I presume that there is some permissions issue trying to install it for all users.
回答2:
Indeed this was a bug from conda. I have made recently some updates that fixe my problem.
来源:https://stackoverflow.com/questions/52973871/no-module-qtmultimedia-mac-os-anaconda-python-3-7-pyqt5