phuhl / notify-send.py

A python-script like libnotify but with improved functionality
Other
95 stars 13 forks source link

Script not added to path upon installation #7

Open WhyNotHugo opened 4 years ago

WhyNotHugo commented 4 years ago

I tries installing this, but it didn't add any script to my PATH, or anything alike. I only got these files when installing via python setup.py:

notify-send.py /usr/
notify-send.py /usr/lib/
notify-send.py /usr/lib/python3.8/
notify-send.py /usr/lib/python3.8/site-packages/
notify-send.py /usr/lib/python3.8/site-packages/notify_send.py-1.2.2-py3.8.egg-info
notify-send.py /usr/lib/python3.8/site-packages/notify_send_py/
notify-send.py /usr/lib/python3.8/site-packages/notify_send_py/__init__.py
notify-send.py /usr/lib/python3.8/site-packages/notify_send_py/__pycache__/
notify-send.py /usr/lib/python3.8/site-packages/notify_send_py/__pycache__/__init__.cpython-38.opt-1.pyc
notify-send.py /usr/lib/python3.8/site-packages/notify_send_py/__pycache__/__init__.cpython-38.pyc
notify-send.py /usr/lib/python3.8/site-packages/notify_send_py/__pycache__/notify_send_py.cpython-38.opt-1.pyc
notify-send.py /usr/lib/python3.8/site-packages/notify_send_py/__pycache__/notify_send_py.cpython-38.pyc
notify-send.py /usr/lib/python3.8/site-packages/notify_send_py/notify_send_py.py

Installing via pip doesn't seem to work at all:

➜ pip install notify-send.py
Collecting notify-send.py
  Downloading notify_send.py-1.2.2-py2.py3-none-any.whl (6.5 kB)
Collecting dbus-python
  Downloading dbus-python-1.2.16.tar.gz (576 kB)
     |████████████████████████████████| 576 kB 4.9 MB/s 
hashCollecting notify2
  Downloading notify2-0.3.1-py2.py3-none-any.whl (8.0 kB)
Collecting pygobject
  Downloading PyGObject-3.36.0.tar.gz (714 kB)
     |████████████████████████████████| 714 kB 27.8 MB/s 

  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Processing ./.cache/pip/wheels/c2/06/6b/839c0659d8100837a927dae943b56669a56eb1da7ab66fb81a/pycairo-1.19.1-cp38-cp38-linux_x86_64.whl
Building wheels for collected packages: dbus-python, pygobject
  Building wheel for dbus-python (setup.py) ... done
  Created wheel for dbus-python: filename=dbus_python-1.2.16-cp38-cp38-linux_x86_64.whl size=408459 sha256=a5ffe5559590ac330ef718f8dbbd4d51fa0e0678f3b2fe32cb0680ff826a953c
  Stored in directory: /home/hugo/.cache/pip/wheels/96/73/ab/d284694896db856003b553f486e866d3829635a1687aa85b70
  Building wheel for pygobject (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/hugo/.local/share/virtualenvs/tmp/bin/python /home/hugo/.local/share/virtualenvs/tmp/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpect8g331
       cwd: /tmp/pip-install-9vbhf6pa/pygobject
  Complete output (43 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/pygtkcompat
  copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-3.8/pygtkcompat
  copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-3.8/pygtkcompat
  copying pygtkcompat/__init__.py -> build/lib.linux-x86_64-3.8/pygtkcompat
  creating build/lib.linux-x86_64-3.8/gi
  copying gi/types.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/pygtkcompat.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/module.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/importer.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/docstring.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/_option.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/_gtktemplate.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/_error.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/_constants.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/_compat.py -> build/lib.linux-x86_64-3.8/gi
  copying gi/__init__.py -> build/lib.linux-x86_64-3.8/gi
  creating build/lib.linux-x86_64-3.8/gi/repository
  copying gi/repository/__init__.py -> build/lib.linux-x86_64-3.8/gi/repository
  creating build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/__init__.py -> build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/Pango.py -> build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/Gio.py -> build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/GdkPixbuf.py -> build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/GObject.py -> build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/GLib.py -> build/lib.linux-x86_64-3.8/gi/overrides
  copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-3.8/gi/overrides
  running build_ext
  Package gobject-introspection-1.0 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'gobject-introspection-1.0', required by 'virtual:world', not found
  Command '('pkg-config', '--print-errors', '--exists', 'gobject-introspection-1.0 >= 1.46.0')' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for pygobject
Successfully built dbus-python
Failed to build pygobject
ERROR: Could not build wheels for pygobject which use PEP 517 and cannot be installed directly
somini commented 3 years ago

Here are some more logs about this:

$ python setup.py build
running build
running build_py
creating build
creating build/lib
creating build/lib/notify_send_py
copying notify_send_py/notify_send_py.py -> build/lib/notify_send_py
copying notify_send_py/__init__.py -> build/lib/notify_send_py
/usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
/usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extras_require'
  warnings.warn(msg)
/usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'entry_points'
  warnings.warn(msg)

This needs some entrypoints:


By the way, the maintainers should add a git tag pointing to the same releases on PyPI, otherwise you can't match the PyPI version to the code.

phuhl commented 3 years ago

Thanks for reporting.

I read a little bit into it and it appears to be normal, that pip-build files are not in the path directory.

For me, pip says explicitly:

 WARNING: The script notify-send.py is installed in '/home/philipp/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

If you have a good suggestion, how this should be fixed (if it is a bug at all), please comment or open a PR

Dragoninventor commented 3 years ago

For anyone this might help, I've found that running sudo pip install notify-send.py as opposed to the command without sudo seems to work without any path errors. Perhaps this could be included in the README so others won't run into this issue.

However I'm new to github, so if this isn't relevant or helpful then my apologies.

phuhl commented 3 years ago

Thanks for the input, I am not sure what the right way to install with pip is. Not sure if sudo is best practice, so I will not put it in the Readme for now, but hopefully, anybody who stumbles across the issue will find the answer here