Variety - Application not Starting

Hey everyone,
A new OpenSUSE user, I just installed the OS yesterday as I wanted to try out non-Arch based distributions and OpenSUSE had the most interesting set of features.

I request the help of the forum with the below issue. The application - variety does not seem to be starting. I am getting the below error message.

:~> variety
Traceback (most recent call last):
  File "/usr/bin/variety", line 38, in <module>
    import variety
  File "/usr/bin/variety.py", line 39, in <module>
    variety.main()
AttributeError: module 'variety' has no attribute 'main'

Earlier the error message was much bigger, but I had searched the forum which advised the installation of the python3-requests package, after which several error messages had disappeared, but still have the above error message. Kindly request you to please help with the same.

Cheers,
RD (y)

Installed variety, it does not work indeed, but … it’s a python2 app… Furthermore the contents of the package have not changed over the past three years.

If the packages for Variety are not maintained,
It looks pretty easy to deploy from source and the project does seem to be active.

Instructions to clone the github repo and install are on the github project page

https://github.com/varietywalls/variety

And BTW - It does seem to be a Python3 app.

Another BTW -
I haven’t looked at what is the openSUSE packages, but you might also just install the dependencies listed for source, but instead of taking the step to build from source to just try running the openSUSE app again. To my eye, none of the Python3 dependencies ordinarily are part of a build so might simply be missing libraries the openSUSE package needs. But of course if as Knupht describes that the app code is years old, the app code and current libraries may be incompatible.

TSU

Additional, the Variety project lists a number of dependencies using Debian/Ubuntu package names.
You may have to find the RPM names for those dependencies, try using the procedure I describe at the following Wiki I created.
If you have problems finding your RPM dependencies, post again for help

https://en.opensuse.org/User:Tsu2/Missing_Files_Dependencies

TSU

Hi
No offence, but PLEASE stop sending people off installing from source and the likes. It’s very frustrating, even more since it’s a package I introduced, but will update/fix if needed. It was updated last year to version 0.6.6, updated to version 0.6.9 in the development repo, seems they introduced a readme, which is all that is breaking the build. So is maintained… in fact it was touched less than a day ago in the development project.

The python3 version which your asking to install @0.7.1 is broken, so your about to send a user off to install something not working…

@OP, please advise if you want me to investigate more, else I’ll just put it on the back burner.

Please, Tsu. It might be easy for YOU to “deploy from source”, but that is gobbledegook to a lot of the Forum Users, something that can be especially off-putting to newcomers.

Because YOU know how to do it, what you should do is try it yourself and make sure it works. If it works, perhaps then make that suggestion, but better still would be if you package a working copy in your own OBS.

If you want to suggest someone install from source, instead of pointing them to very technical instructions, please instruct step-by-step in terms that NEWBIES can understand, so that ALL Forum Users can benefit from and use the instructions.

Hi
@rainingdistros, so I’ve updated the package to version 0.7.1 which is the python3 release (and fixed), I have a test package here;

https://build.opensuse.org/package/show/home:malcolmlewis:branches:X11:Utilities/variety

(Don’t normally publish branched packages)


wget https://download.opensuse.org/repositories/home:/malcolmlewis:/branches:/X11:/Utilities/openSUSE_Tumbleweed/noarch/variety-0.7.1-31.1.noarch.rpm
zypper in variety-0.7.1-31.1.noarch.rpm
<ignore key request and install>

Can you (and anyone else) test and advise back on any issues, will push to the development repo and make sure it gets pushed to Factory.

Hey everyone,
I am really happy to see the response that is being provided to the new users here…
Appreciate all the help.
Thank you so much.

Thank you for putting together the version.
I did try to install the version, but I am receiving errors.

On first install for the below error.

:~> variety
Traceback (most recent call last):
  File "/usr/bin/variety", line 38, in <module>
    import variety
  File "/usr/lib/python3.6/site-packages/variety/__init__.py", line 93, in <module>
    from variety import VarietyWindow
  File "/usr/lib/python3.6/site-packages/variety/VarietyWindow.py", line 51, in <module>
    from variety.PreferencesVarietyDialog import PreferencesVarietyDialog
  File "/usr/lib/python3.6/site-packages/variety/PreferencesVarietyDialog.py", line 24, in <module>
    from variety.Util import Util
  File "/usr/lib/python3.6/site-packages/variety/Util.py", line 17, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

So I had installed the python3-requests package thinking it might be fix the issue.
But received another error message.

:~> variety
Traceback (most recent call last):
  File "/usr/bin/variety", line 38, in <module>
    import variety
  File "/usr/lib/python3.6/site-packages/variety/__init__.py", line 93, in <module>
    from variety import VarietyWindow
  File "/usr/lib/python3.6/site-packages/variety/VarietyWindow.py", line 67, in <module>
    from variety.QuoteWriter import QuoteWriter
  File "/usr/lib/python3.6/site-packages/variety/QuoteWriter.py", line 17, in <module>
    import cairo
ModuleNotFoundError: No module named 'cairo'

So now I tried installing python3-cairo package. But it seems to be issuing a different error now.

:~> variety
Traceback (most recent call last):
  File "/usr/bin/variety", line 39, in <module>
    variety.main()
  File "/usr/lib/python3.6/site-packages/variety/__init__.py", line 198, in main
    window.start(arguments)
  File "/usr/lib/python3.6/site-packages/variety/VarietyWindow.py", line 149, in start
    self.register_clipboard()
  File "/usr/lib/python3.6/site-packages/variety/VarietyWindow.py", line 327, in register_clipboard
    self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
  File "/usr/lib64/python3.6/site-packages/gi/module.py", line 132, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gdk' object has no attribute 'SELECTION_CLIPBOARD'

Kindly do help.

Cheers,
RD

Truth be told, before posting for help I did try to build the application from the source, but there were few packages for which I could not find.
Say for example python3-pillow was one of the packages I could not find. I was able to find python3-pilkit but not this…Anyways thanks to Malcolm for putting together the app.
I hope I can help test the app and move it to the official repos.

Installed, works as expected.

Hi
Thanks all for testing, it’s (version 0.7.1) now accepted in the development repo, https://software.opensuse.org/package/variety so it can be installed from here.

Hopefully the staging bot will pick it up and automagically move to openQA and Tumbleweed.

Hi everyone,
Can you please help me. I think I am missing something.
I still am getting the below error message. I had uninstalled and had installed via the link you had shared. (From Experimental Package)
Please help…

:~> variety
Traceback (most recent call last):
  File "/usr/bin/variety", line 39, in <module>
    variety.main()
  File "/usr/lib/python3.6/site-packages/variety/__init__.py", line 198, in main
    window.start(arguments)
  File "/usr/lib/python3.6/site-packages/variety/VarietyWindow.py", line 149, in start
    self.register_clipboard()
  File "/usr/lib/python3.6/site-packages/variety/VarietyWindow.py", line 327, in register_clipboard
    self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
  File "/usr/lib64/python3.6/site-packages/gi/module.py", line 132, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gdk' object has no attribute 'SELECTION_CLIPBOARD'

Hi
Looks like some remnants from your manual install left over. Can you remove the ~/.config/variety directory. I would also use the -f option to re-install the variety rpm.


wget https://download.opensuse.org/repositories/X11:/Utilities/openSUSE_Tumbleweed/noarch/variety-0.7.1-34.1.noarch.rpm
zypper in -f variety-0.7.1-34.1.noarch.rpm

Thank you for your response Malcolm, But I am still receiving the same error.

  1. Uninstalled the existing application.
  2. Deleted the variety folder inside .config path.
  3. Re-installed as per your instructions.
:~> sudo zypper in -f variety-0.7.1-34.1.noarch.rpm
Loading repository data...
Reading installed packages...
Forcing installation of 'variety-0.7.1-34.1.noarch' from repository 'Plain RPM files cache'.
Resolving package dependencies...

The following NEW package is going to be installed:
  variety

1 new package to install.
Overall download size: 611.0 KiB. Already cached: 0 B. After the operation, additional 2.0 MiB will be used.
Continue? [y/n/...? shows all options] (y): y
Retrieving package variety-0.7.1-34.1.noarch                                                                    (1/1), 611.0 KiB (  2.0 MiB unpacked)
Checking for file conflicts: ..................................................................................................................[done]
(1/1) Installing: variety-0.7.1-34.1.noarch ...................................................................................................[done]

:~> variety
Traceback (most recent call last):
  File "/usr/bin/variety", line 39, in <module>
    variety.main()
  File "/usr/lib/python3.6/site-packages/variety/__init__.py", line 198, in main
    window.start(arguments)
  File "/usr/lib/python3.6/site-packages/variety/VarietyWindow.py", line 149, in start
    self.register_clipboard()
  File "/usr/lib/python3.6/site-packages/variety/VarietyWindow.py", line 327, in register_clipboard
    self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
  File "/usr/lib64/python3.6/site-packages/gi/module.py", line 132, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gdk' object has no attribute 'SELECTION_CLIPBOARD' 

Can you please help in figuring out what the error is ?

Cheers,
RD,

Hi
Can you look at the file;


/usr/lib/python3.6/site-packages/variety_lib/varietyconfig.py

Around line 28 in this file, what is the setting for “variety_data_directory”?

The file has the following contents around line 28.

    28  # Where your project will look for your data (for instance, images and ui
    29  # files). By default, this is ../data, relative your trunk layout
    30  __variety_data_directory__ = '/usr/share/variety'
    31  __license__ = 'GPL-3'
    32  __version__ = '0.7.1'


Hi
Hmmmm, ok can you unitstall the rpm;


zypper rm variety

Then check the following directories and file exist (maybe remnants from the manual build/install) are left;


ls /usr/lib/python3.6/site-packages/jumble 
ls /usr/lib/python3.6/site-packages/variety
ls /usr/lib/python3.6/site-packages/variety_lib
ls /usr/lib/python3.6/site-packages/variety-*.egg-info
ls /usr/share/variety
ls /usr/bin/variety

Hi,
Followed the instructions.
Removed variety and then verified the files. Shall I try installing once more or is there any other checks that we need to do ?

-gt3l:~> ls /usr/lib/python3.6/site-packages/jumble
ls: cannot access '/usr/lib/python3.6/site-packages/jumble': No such file or directory
-gt3l:~> ls /usr/lib/python3.6/site-packages/variety
ls: cannot access '/usr/lib/python3.6/site-packages/variety': No such file or directory
-gt3l:~> ls /usr/lib/python3.6/site-packages/variety_lib
ls: cannot access '/usr/lib/python3.6/site-packages/variety_lib': No such file or directory
-gt3l:~> ls /usr/lib/python3.6/site-packages/variety-*.egg-info
ls: cannot access '/usr/lib/python3.6/site-packages/variety-*.egg-info': No such file or directory
-gt3l:~> ls /usr/share/variety
ls: cannot access '/usr/share/variety': No such file or directory
-gt3l:~> ls /usr/bin/variety
ls: cannot access '/usr/bin/variety': No such file or directory

Hi
And nothing ‘variety related’ directories/files down in the /usr/lib/python2.7 /usr/lib64/python, python2.7 and python3.6 directories either?


find /usr/lib/python* variety*
find /usr/lib64/python* variety*

==> find: ‘variety*’: No such file or directory <== is good ;)