-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError on multiple submodule #269
Comments
The good practice is to import those if you need them. It is not a guarantee in Python packaging that a package should import all its sub-packages in its toplevel namespace... |
Just to be clear - that means that in your code you should:
or
|
Sorry for a little delayed response but I can import it after restarting my system. But now I am getting the following error Traceback (most recent call last):
File "/Users/mayukhsarkar/Documents/Codes/ACE/venv/lib/python3.6/site-packages/logbook/notifiers.py", line 75, in __init__
import Growl
ModuleNotFoundError: No module named 'Growl'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/mayukhsarkar/Library/Preferences/PyCharmCE2018.2/scratches/scratch.py", line 3, in <module>
create_notification_handler()
File "/Users/mayukhsarkar/Documents/Codes/ACE/venv/lib/python3.6/site-packages/logbook/notifiers.py", line 33, in create_notification_handler
return GrowlHandler(application_name, level=level, icon=icon)
File "/Users/mayukhsarkar/Documents/Codes/ACE/venv/lib/python3.6/site-packages/logbook/notifiers.py", line 78, in __init__
raise RuntimeError('The growl module is not available. You have '
RuntimeError: The growl module is not available. You have to install either growl-py or py-Growl to use the GrowlHandler. |
@MayukhSobo IIRC the |
@vmalloc Yes but two things here. First, installing Logbook should have installed all its dependencies which it didn't |
Growl is not a dependency of Logbook. It doesn't make sense forcing such an unrelated package by default. The right thing is to use extras, and that we should probably do. Until then the right thing to do is include Growl in your own requirements if you require it. Logbook should work with or without it until it requires a feature provided by it. Secondly, it's strange that |
Yup, this seems broken... I don't think it ever worked :-( If you can provide a PR that fixes it that would be very welcome. |
Okay....I seemed to have figured out the problem.. |
@MayukhSobo what is it? I don't see how that import can work in today's |
Actually can you point out where did you see the growl package? If it is this link then the problem is that it has to be installed and imported with PS: Please mention if you have user some other package. This seems to the most updated growl for MacOS but I will have to test it. Please close this issue and open a new one.. |
Yes the problem is the code is attempting to import a name not provided by the specific package known as |
I was wondering if you can move to a better notification system as the current one using Growl is pretty old and requires a paid Growl service. |
I am getting
AttributeError
on multiple imports specially the imports likelogbook.notifiers
logbook.more
I went ahead checking your
__init__.py
file and didn't see any entry for these modulesThe text was updated successfully, but these errors were encountered: