nwg-piotr/azote

Unable to install

Findarato opened this issue · 5 comments

I am using Fedora 30, with Python 3.7

When running python3 setup.py install the site packages are not installed. They are also statically calling global installed locations so installing at the user level fails.

Well, I didn't really intend this code to be installed directly with setup.py. Also I know nothing about Fedora. However:

  1. python setup.py install --root="$pkgdir/" --optimize=1 command in Arch PKGBUILD performs installation correctly.

  2. I've just checked setup.py install on my netbook, which runs Void Linux, and everything went well, to my surprise:

$ sudo python3 setup.py install
Hasło: 
running install
running bdist_egg
running egg_info
creating azote.egg-info
writing azote.egg-info/PKG-INFO
writing dependency_links to azote.egg-info/dependency_links.txt
writing requirements to azote.egg-info/requires.txt
writing top-level names to azote.egg-info/top_level.txt
writing manifest file 'azote.egg-info/SOURCES.txt'
reading manifest file 'azote.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'azote.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/azote
copying azote/main.py -> build/lib/azote
copying azote/tools.py -> build/lib/azote
copying azote/common.py -> build/lib/azote
copying azote/__init__.py -> build/lib/azote
creating build/lib/azote/images
copying azote/images/azote-wallpaper.jpg -> build/lib/azote/images
copying azote/images/azote-wallpaper1.jpg -> build/lib/azote/images
copying azote/images/azote-wallpaper2.jpg -> build/lib/azote/images
copying azote/images/azote.svg -> build/lib/azote/images
copying azote/images/empty.png -> build/lib/azote/images
copying azote/images/icon_about.svg -> build/lib/azote/images
copying azote/images/icon_open.svg -> build/lib/azote/images
copying azote/images/icon_refresh.svg -> build/lib/azote/images
creating build/lib/azote/languages
copying azote/languages/README.md -> build/lib/azote/languages
copying azote/languages/en_EN -> build/lib/azote/languages
copying azote/languages/pl_PL -> build/lib/azote/languages
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/azote
creating build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/icon_open.svg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/azote-wallpaper.jpg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/azote-wallpaper2.jpg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/icon_refresh.svg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/azote.svg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/azote-wallpaper1.jpg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/icon_about.svg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/empty.png -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/main.py -> build/bdist.linux-x86_64/egg/azote
creating build/bdist.linux-x86_64/egg/azote/languages
copying build/lib/azote/languages/pl_PL -> build/bdist.linux-x86_64/egg/azote/languages
copying build/lib/azote/languages/README.md -> build/bdist.linux-x86_64/egg/azote/languages
copying build/lib/azote/languages/en_EN -> build/bdist.linux-x86_64/egg/azote/languages
copying build/lib/azote/tools.py -> build/bdist.linux-x86_64/egg/azote
copying build/lib/azote/common.py -> build/bdist.linux-x86_64/egg/azote
copying build/lib/azote/__init__.py -> build/bdist.linux-x86_64/egg/azote
byte-compiling build/bdist.linux-x86_64/egg/azote/main.py to main.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/azote/tools.py to tools.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/azote/common.py to common.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/azote/__init__.py to __init__.cpython-36.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/azote-0.0.3-py3.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing azote-0.0.3-py3.6.egg
Copying azote-0.0.3-py3.6.egg to /usr/lib/python3.6/site-packages
Adding azote 0.0.3 to easy-install.pth file

Installed /usr/lib/python3.6/site-packages/azote-0.0.3-py3.6.egg
Processing dependencies for azote==0.0.3
Searching for Pillow==5.4.1
Best match: Pillow 5.4.1
Adding Pillow 5.4.1 to easy-install.pth file

Using /usr/lib/python3.6/site-packages
Searching for PyGObject==3.32.0
Best match: PyGObject 3.32.0
Adding PyGObject 3.32.0 to easy-install.pth file

Using /usr/lib/python3.6/site-packages
Finished processing dependencies for azote==0.0.3

Could you check one more time?

I updated the repo right before running and here is the result.

sudo python3 setup.py install
running install
running bdist_egg
running egg_info
creating azote.egg-info
writing azote.egg-info/PKG-INFO
writing dependency_links to azote.egg-info/dependency_links.txt
writing requirements to azote.egg-info/requires.txt
writing top-level names to azote.egg-info/top_level.txt
writing manifest file 'azote.egg-info/SOURCES.txt'
reading manifest file 'azote.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'azote.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/azote
copying azote/common.py -> build/lib/azote
copying azote/main.py -> build/lib/azote
copying azote/__init__.py -> build/lib/azote
copying azote/tools.py -> build/lib/azote
creating build/lib/azote/images
copying azote/images/azote-wallpaper.jpg -> build/lib/azote/images
copying azote/images/azote-wallpaper1.jpg -> build/lib/azote/images
copying azote/images/azote-wallpaper2.jpg -> build/lib/azote/images
copying azote/images/azote.svg -> build/lib/azote/images
copying azote/images/empty.png -> build/lib/azote/images
copying azote/images/icon_about.svg -> build/lib/azote/images
copying azote/images/icon_open.svg -> build/lib/azote/images
copying azote/images/icon_refresh.svg -> build/lib/azote/images
creating build/lib/azote/languages
copying azote/languages/README.md -> build/lib/azote/languages
copying azote/languages/en_EN -> build/lib/azote/languages
copying azote/languages/pl_PL -> build/lib/azote/languages
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/azote
copying build/lib/azote/common.py -> build/bdist.linux-x86_64/egg/azote
copying build/lib/azote/main.py -> build/bdist.linux-x86_64/egg/azote
creating build/bdist.linux-x86_64/egg/azote/languages
copying build/lib/azote/languages/README.md -> build/bdist.linux-x86_64/egg/azote/languages
copying build/lib/azote/languages/en_EN -> build/bdist.linux-x86_64/egg/azote/languages
copying build/lib/azote/languages/pl_PL -> build/bdist.linux-x86_64/egg/azote/languages
copying build/lib/azote/__init__.py -> build/bdist.linux-x86_64/egg/azote
creating build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/icon_open.svg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/azote-wallpaper2.jpg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/icon_about.svg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/icon_refresh.svg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/azote.svg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/azote-wallpaper1.jpg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/empty.png -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/images/azote-wallpaper.jpg -> build/bdist.linux-x86_64/egg/azote/images
copying build/lib/azote/tools.py -> build/bdist.linux-x86_64/egg/azote
byte-compiling build/bdist.linux-x86_64/egg/azote/common.py to common.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/azote/main.py to main.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/azote/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/azote/tools.py to tools.cpython-37.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying azote.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/azote-0.0.3-py3.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing azote-0.0.3-py3.7.egg
Copying azote-0.0.3-py3.7.egg to /usr/local/lib/python3.7/site-packages
Removing azote 0.0.2 from easy-install.pth file
Adding azote 0.0.3 to easy-install.pth file

Installed /usr/local/lib/python3.7/site-packages/azote-0.0.3-py3.7.egg
Processing dependencies for azote==0.0.3
Searching for Pillow==5.4.1
Best match: Pillow 5.4.1
Adding Pillow 5.4.1 to easy-install.pth file

Using /usr/lib64/python3.7/site-packages
Searching for PyGObject==3.32.1
Best match: PyGObject 3.32.1
Adding PyGObject 3.32.1 to easy-install.pth file

Using /usr/lib64/python3.7/site-packages
Finished processing dependencies for azote==0.0.3

When I try and run the azote command under dist/

./azote 
./azote: line 3: cd: /usr/lib/python3.7/site-packages/azote: No such file or directory
python: can't open file 'main.py': [Errno 2] No such file or directory

To run the python script from terminal:

cd /usr/lib64/python3.7/site-packages
python3 main.py

Or better do what's being done while the package installation: copy files from here to locations as below.

/usr/bin/azote
/usr/share/applications/azote.desktop
/usr/share/azote/azote.svg

Change #!/bin/sh in the azote shell script to whatever it should look like in Fedora (#!/usr/bin/env bash) should work on every distro). Change path to appropriate to your package location(/usr/lib64/python3.7/site-packages) Don't forget to make /usr/bin/azote executable.

Now you have the terminal command and the desktop shortcut.

OK I am making some progress. If I go in and manually run main.py from the azote directory this happens:

python3 main.py 
/bin/sh: wmctrl: command not found
main.py:386: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "title, parent, action" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  dialog = Gtk.FileChooserDialog("Open folder", button.get_toplevel(), Gtk.FileChooserAction.SELECT_FOLDER)

Factory fedora requires

dnf install pygobject3 python3-gobject

Also after moving all of the files and calling azote from dist

Traceback (most recent call last):
  File "main.py", line 540, in <module>
    sys.exit(main())
  File "main.py", line 533, in main
    set_env(lang)  # detect displays, check installed modules, set paths and stuff
  File "/usr/lib64/python3.7/site-packages/azote/tools.py", line 133, in set_env
    common.lang = Language()
  File "/usr/lib64/python3.7/site-packages/azote/tools.py", line 359, in __init__
    super().__init__()
TypeError: super() takes at least 1 argument (0 given)

I am sorry for being a bother about this.

No problem.

The setup.py script only installs required python modules. Of the rest of dependencies you must take care on your own, and those are:

depends=('python' 'python-setuptools' 'python-gobject' 'python-pillow' 'wget' 'feh' 'xorg-xrandr' 'wmctrl')

Package names may vary for Fedora, I'm not sure.

If would be better if someone could make a Fedora package, but I'll add dependencies info to README, just in case.

If it comes to the (harmless) main.py:386: PyGTKDeprecationWarning: I thought I cleared all deprecated code last night. Are you sure you're installing from the latest sources?