anime-dl / anime-downloader

A simple but powerful anime downloader and streamer.
The Unlicense
1.92k stars 218 forks source link

ERROR: No module named 'PyQt5' #566

Closed crimson-med closed 3 years ago

crimson-med commented 3 years ago

Describe the bug GUI version does not launch

ERROR: No module named 'PyQt5'

To reproduce

- Install the mac version 
- Run anime gui
- Terminal will display
- ERROR: No module named 'PyQt5'

More Info

I have tried running

brew install pyqt 

If I run brew info pyqt5 I get the following output:

pyqt: stable 5.15.1 (bottled)
Python bindings for v5 of Qt
https://www.riverbankcomputing.com/software/pyqt/download5
/usr/local/Cellar/pyqt/5.15.1_1 (961 files, 27MB) *
  Poured from bottle on 2020-10-29 at 12:20:12
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/pyqt.rb
License: GPL-3.0-only
==> Dependencies
Required: python@3.9 ✔, qt ✔, sip ✔
==> Analytics
install: 38,645 (30 days), 77,772 (90 days), 155,015 (365 days)
install-on-request: 9,871 (30 days), 17,897 (90 days), 62,466 (365 days)
build-error: 0 (30 days)
LOG ``` Traceback (most recent call last): File "/usr/local/bin/anime", line 33, in sys.exit(load_entry_point('anime-downloader==5.0.1', 'console_scripts', 'anime')()) File "/usr/local/Cellar/anime-downloader/5.0.1/libexec/lib/python3.9/site-packages/anime_downloader/cli.py", line 53, in main cli() File "/usr/local/Cellar/anime-downloader/5.0.1/libexec/lib/python3.9/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/usr/local/Cellar/anime-downloader/5.0.1/libexec/lib/python3.9/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/Cellar/anime-downloader/5.0.1/libexec/lib/python3.9/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/Cellar/anime-downloader/5.0.1/libexec/lib/python3.9/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/Cellar/anime-downloader/5.0.1/libexec/lib/python3.9/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/usr/local/Cellar/anime-downloader/5.0.1/libexec/lib/python3.9/site-packages/anime_downloader/commands/gui.py", line 6, in command import anime_downloader.gui File "/usr/local/Cellar/anime-downloader/5.0.1/libexec/lib/python3.9/site-packages/anime_downloader/gui.py", line 3, in from PyQt5 import QtWidgets, QtGui, QtCore ModuleNotFoundError: No module named 'PyQt5' ```
IguanasInPyjamas commented 3 years ago

The GUI needs an extra dependency for pyqt. From the README: "To install this project with gui and all its dependencies, add #egg=anime-downloader[gui] to the pip command you are using to install it. Example: pip install -U git+https://github.com/anime-dl/anime-downloader#egg=anime_downloader[gui]"

Try installing pyqt5 through pip, and see if the problem persists.

crimson-med commented 3 years ago

@IguanasInPyjamas so the homebrew installation does not work for mac? Should the install docs be updated then?

IguanasInPyjamas commented 3 years ago

No, the homebrew installation should work for anime-dl, you're wanting anime-dl + GUI, the GUI install options are directly mentioned in the README (we have to treat them separately technically as having pyqt5 as a direct dependency breaks android)

All you need to do is pip install PyQt5 and the GUI should fully work. Please, give it a go.

crimson-med commented 3 years ago

Per my previous comment I have already installed PyQT5 (more info section)

Running:

pip3 install PyQt5

Results in:

Requirement already satisfied: PyQt5 in /usr/local/lib/python3.9/site-packages (5.15.1)
IguanasInPyjamas commented 3 years ago

That is interesting, maybe you now have more than one python environment installed? does brew create it's own copy of python, on one of my pcs I had an issue like this where pyqt was only being picked up by anaconda for a while but I can't remember how I fixed it.

If the module is installed I have no answer to why a python import command is failing, and I don't have a mac to test this :/

IguanasInPyjamas commented 3 years ago

Looking through stackexchange, mostly it comes through when you have different environments, if you can -m pip install pyqt on the right python on your system it'll import. Check these following stackoverflow links;

https://stackoverflow.com/questions/53460186/pyqt5-modulenotfounderror-no-module-named-pyqt5

https://stackoverflow.com/questions/56031636/pycharm-error-modulenotfounderror-no-module-named-pyqt5

https://stackoverflow.com/questions/57485461/pyqt5-qtwidgets-module-not-found-when-pyqt-is-installed-with-anaconda

The last one specifically may be of use, if you have multiple pythons in your path it takes the top-most one as first, if that one doesn't have the module then it won't pull the import

crimson-med commented 3 years ago

if I use

brew list python python3

I only get python3.9 listed

/usr/local/Cellar/python@3.9/3.9.0_1/bin/2to3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/2to3-3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/easy_install-3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/idle3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/idle3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/pip3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/pip3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/pydoc3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/pydoc3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/python3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/python3-config
/usr/local/Cellar/python@3.9/3.9.0_1/bin/python3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/python3.9-config
/usr/local/Cellar/python@3.9/3.9.0_1/bin/wheel3
/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/ (3032 files)
/usr/local/Cellar/python@3.9/3.9.0_1/IDLE 3.app/Contents/ (8 files)
/usr/local/Cellar/python@3.9/3.9.0_1/lib/pkgconfig/ (4 files)
/usr/local/Cellar/python@3.9/3.9.0_1/libexec/bin/ (7 files)
/usr/local/Cellar/python@3.9/3.9.0_1/libexec/pip/ (852 files)
/usr/local/Cellar/python@3.9/3.9.0_1/libexec/setuptools/ (511 files)
/usr/local/Cellar/python@3.9/3.9.0_1/libexec/wheel/ (60 files)
/usr/local/Cellar/python@3.9/3.9.0_1/Python Launcher 3.app/Contents/ (16 files)
/usr/local/Cellar/python@3.9/3.9.0_1/share/man/ (2 files)
/usr/local/Cellar/python@3.9/3.9.0_1/bin/2to3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/2to3-3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/easy_install-3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/idle3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/idle3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/pip3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/pip3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/pydoc3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/pydoc3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/python3
/usr/local/Cellar/python@3.9/3.9.0_1/bin/python3-config
/usr/local/Cellar/python@3.9/3.9.0_1/bin/python3.9
/usr/local/Cellar/python@3.9/3.9.0_1/bin/python3.9-config
/usr/local/Cellar/python@3.9/3.9.0_1/bin/wheel3
/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/ (3032 files)
/usr/local/Cellar/python@3.9/3.9.0_1/IDLE 3.app/Contents/ (8 files)
/usr/local/Cellar/python@3.9/3.9.0_1/lib/pkgconfig/ (4 files)
/usr/local/Cellar/python@3.9/3.9.0_1/libexec/bin/ (7 files)
/usr/local/Cellar/python@3.9/3.9.0_1/libexec/pip/ (852 files)
/usr/local/Cellar/python@3.9/3.9.0_1/libexec/setuptools/ (511 files)
/usr/local/Cellar/python@3.9/3.9.0_1/libexec/wheel/ (60 files)
/usr/local/Cellar/python@3.9/3.9.0_1/Python Launcher 3.app/Contents/ (16 files)
/usr/local/Cellar/python@3.9/3.9.0_1/share/man/ (2 files)

Also tried

sudo python3 -m pip install PyQt5

And i get the same:

Requirement already satisfied: PyQt5 in /usr/local/lib/python3.9/site-packages (5.15.1)
ProductiveAsparagus56 commented 3 years ago

@crimson-med try /usr/local/opt/python@3.9/libexec/bin/python -m pip install PyQt5 worked for me after installing with homebrew.

edit: spoke way too soon... still same error

IguanasInPyjamas commented 3 years ago

this is a package install issue, not to do with anime-dl