ImportError: There is no module named pynotify. While the module is installed

So this error keeps coming back.

Every time I try to configure a script, it returns:

Traceback (most recent call last): File "cli.py", line 11, in <module> import pynotify ImportError: No module named pynotify 

The strange thing is, I just installed this plugin. I also restarted the command prompt again, even the computer.

But nothing, if anyone could help me, that would be great!

+6
source share
6 answers

Try the following:

 pip install py-notify 

It worked for me.

+4
source

You are most likely looking for pyinotify not pynotify . This should fix your ImportError.

+1
source

Here is the solution for Ubuntu.

Install python-notify : sudo apt-get install python-notify After that, you may need to add the correct paths:

 import sys sys.path.append('/usr/lib/python2.7/dist-packages/gtk-2.0') sys.path.append('/usr/lib/python2.7/dist-packages/') 

Finally: import pynotify

+1
source

If you install py-notify ( http://home.gna.org/py-notify/ ), it should be:

 import notify 
0
source

Check if you are using the appropriate protocol version for your version of Python. For example, if you have Python2 and Python3 installed, you can install pynotify for Python2 and try to import it from Python3, which will cause the package to not be found.

Try to run

 pip --version 

Assuming pip install , how did you install the package, and also

 python --version 

to make sure the version numbers are similar.

0
source

first check the pip version and current python version

pip --version, python --version

if pip is from python3 packages. and the python environment runs on python2.x. so give up using pip to install any notify , you just install python-notify

0
source

Source: https://habr.com/ru/post/978597/


All Articles