Skip to content
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

Autokey won't launch: missing module named 'autokey'. Probably, outdated wiki. #925

Open
7 of 16 tasks
Fenimoure opened this issue Dec 7, 2023 · 11 comments
Open
7 of 16 tasks
Labels
help-wanted installation/configuration user support Requests for support - best handled on our forums

Comments

@Fenimoure
Copy link

AutoKey is a Xorg application and will not function in a Wayland session. Do you use Xorg (X11) or Wayland?

Xorg

Has this issue already been reported?

  • I have searched through the existing issues.

Is this a question rather than an issue?

  • This is not a question.

What type of issue is this?

Bug

Choose one or more terms that describe this issue:

  • autokey triggers
  • autokey-gtk
  • autokey-qt
  • beta
  • bug
  • critical
  • development
  • documentation
  • enhancement
  • installation/configuration
  • phrase expansion
  • scripting
  • technical debt
  • user interface

Other terms that describe this issue if not provided above:

ModuleNotFoundError

Which Linux distribution did you use?

Fedora 39

Which AutoKey GUI did you use?

GTK

Which AutoKey version did you use?

No response

How did you install AutoKey?

Zero-installation method from your repository

Can you briefly describe the issue?

No response

Can the issue be reproduced?

Always

What are the steps to reproduce the issue?

  1. cd autokey/lib/autokey/
  2. python3 gtkapp.py

What should have happened?

Program launches

What actually happened?

Error:

Traceback (most recent call last):
  File "/home/fenimoure/autokey/lib/autokey/gtkapp.py", line 17, in <module>
    import autokey.dbus_service
ModuleNotFoundError: No module named 'autokey'

Do you have screenshots?

No response

Can you provide the output of the AutoKey command?

No response

Anything else?

Commands used to invoke autokey:

cd ~/autokey/lib/autokey/
python3 gtkapp.py

All the instructions say to launch autokey-gtk or autokey-qt. However, these files are nowhere to be found. Note, I was using zero-installation method.

Python version

  • python 3.12.0

System info report


Details

  • Created: 2023-12-07 13:10:51

Hardware Information:

  • Hardware model: Lenovo Legion 5 15ACH6H
  • RAM: 16,0 ГіБ
  • CPU: AMD Ryzen™ 5 5600H with Radeon™ Graphics × 12
  • GPU: NVIDIA GeForce RTX™ 3060 Laptop GPU
  • Drive: 1,0 ТБ

Software Information:

  • Firmware: GKCN59WW
  • OS: Fedora Linux 39 (Workstation Edition)
  • OS version: 64-бітова
  • GNOME version: 45.2
  • Window manager: X11
  • Kernel version: Linux 6.6.3-200.fc39.x86_64
@josephj11
Copy link
Contributor

josephj11 commented Dec 7, 2023

Welcome to the AutoKey community, @Fenimoure !

I haven't used Fedora in ages, so I may be off, but:

Generally, you want to invoke autokey-qt or autokey-gtk. Debian also adds autokey to /etc/alternatives as a symlink to the appropriate front end. You can do something similar in Fedora.

Could you install AutoKey with dnf? It should add it to your launcher with an appropriate invocation command that you can copy for use in the CLI, etc. Hopefully, Fedora has AutoKey 0.96.0 in its repositories. The zero install method is usually only used when no package is available on a distro or if you plan to do more advanced things like modifying/developing AutoKey or helping out by running alpha or beta releases of AutoKey along side of the stable release.

If 0.96.0 isn't available on Fedora, it might be interesting to see if alien or a similar tool could convert our debs into rpms, or whatever Fedora is using these days for packages.

We don't have specific installation instructions for Fedora/RedHat. If you come up with a good method, you are welcome to add it to the wiki.

FYI: I don't believe we have done anything with Python 3.12 yet. I know our CI/CD isn't set up for it yet. So there might be issues. If you run into any, you can try running AutoKey under 3.8 ... 3.11. And you can file issues for anything related to 3.12.

We currently have < 1 developers, so getting anything fixed or getting highly technical support may take a long time. In the mean time, you can join the community discussions on Google Groups (basic support) or on Gitter (more advanced support).

Just reread your post.

I have autokey-qt and autokey-gtk in /usr/bin, but I don't immediately see how they got there. (I installed using apt on Kubuntu.) I'm going to ask over on Gitter and see if any Fedora users are there.

@josephj11
Copy link
Contributor

josephj11 commented Dec 7, 2023

Here's my autokey-gtk file. It's slightly old (based on the last beta release that became 0.96.0), but it should work.

You probably have to delete the two "b10" substrings.

#!/usr/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'autokey==0.96.0b10','console_scripts','autokey-gtk'
__requires__ = 'autokey==0.96.0b10'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('autokey==0.96.0b10', 'console_scripts', 'autokey-gtk')()
    )

@josephj11 josephj11 added help-wanted installation/configuration user support Requests for support - best handled on our forums labels Dec 7, 2023
@Elliria
Copy link
Contributor

Elliria commented Dec 7, 2023

This may have been my fault for not doing a good job on the Zero-installation Method section in the wiki. It's updated now. When used as a clone without installing, AutoKey should be invoked as a Python module (see step 7 in that wiki section) and can include command-line switches (see the the notes for that wiki section).

@kreezxil
Copy link

kreezxil commented Dec 7, 2023

@josephj11 @Elliria, do we now support Wayland? Which is the opening question in the starting issue. I thought for sure we have issues with folks trying to get anything to work in it for AK, because of that, it is not X11 in the least.

@josephj11
Copy link
Contributor

@kreezxil @sebastiansam55 created a new version in his personal repo that uses uinput and works on Wayland, but is lacking some features like window filters. He told us how to test it, but I don't know where that thread is. His version detects Wayland/X11 and automatically chooses the appropriate API infrastructure.

So, no, we don't support Wayland, but we hope to in the future. it's not clear if Wayland can provide everything that AutoKey needs to be fully functional.

@topper68
Copy link

You need to install pyasyncore

Use this command

`sudo dnf install python3-pyasyncore

@kreezxil
Copy link

You need to install pyasyncore

Use this command

`sudo dnf install python3-pyasyncore

I recommend just saying install "python3-pyasyncore" because not all of us use Fedora. I'm on Manjaro and that dnf confused me.

That said, is AK working for you in a most excellent way with that installed in Wayland?

@dlk3
Copy link

dlk3 commented Apr 19, 2024

I am a Fedora 39 user running Autokey.

Are you using Gnome? It is the default Fedora desktop environment. If so it may be that Autokey is running but you cannot see its icon in the system tray because Gnome 3 has done away with the system tray by default. I use a Gnome extension called "AppIndicator and KStatusNotifierItem Support " to add a system application tray to my desktop and make the Autokey tray icon visible and clickable. Gnome extensions are installed through your web browser and require that you add a browser plugin called "Gnome Shell Integration" to provide the integration necessary to do that. Details on all this are at https://extensions.gnome.org/about/

If that isn't your problem then maybe something in what follows might suggest something useful;:

The original report says that you're not using Wayland. Good, I don't use it either.

The original report suggests to me that you tried to install Autokey from source. I've done that in the past and have never had a problem. Right now, however, I am running the version of Autokey that comes as part of the Fedora 39 distribution. It is version 0.96.0 which is the current version.

The Fedora 39 distribution delivers Autokey in three RPM packages: autokey-common, autokey-qt, and autokey-gtk. To install autokey you should install either the autokey-gtk or the autokey-qt package, depending on the desktop environment you use. Either of those will automagically install autokey-common as a dependency. Since I use the Gnome, I install autokey-gtk. (No harm will come if you want to install them both side-by-side and try them both to see which works better in your desktop environment. Once you've decided, if you want to recover the tiny amount of disk space involved, you can simply uninstall the one you won't be using, no worries.)

The autokey-common package contains all of the Autokey Python modules and will, through dependencies, make sure that any additional required Python modules are installed. The autokey-gtk/qt packages contain Autokey's desktop UI components compiled with the GTK or QT frameworks respectively.

You can either use the desktop icon to start Autokey, or start it from the command line or in a script using the "autokey-gtk" or "autokey-qt" commands.

As a Gnome user, to autostart Autokey at login I can do either one of the following:

  • Run the command: ln -s /usr/share/applications/autokey-gtk.desktop ~/.config/autostart/
  • Install the gnome-tweaks RPM package and use the Gnome application called "Tweaks" to add Autokey to the list of "Startup Applications" as a regular user (not root.)

@josephj11
Copy link
Contributor

@Fenimoure Is this resolved for you? If not, how can we help? If so, please close this issue.

@josephj11
Copy link
Contributor

@kreezxil This issue is Fedora specific, so using dnf which is the Fedora equivalent of apt is appropriate.

@Puxap-3opre
Copy link

Puxap-3opre commented Apr 27, 2024

Edit: nevermind, I just had to rebuild the package as explained here:
https://bbs.archlinux.org/viewtopic.php?pid=2114044#p2114044

cd /tmp
git clone https://aur.archlinux.org/autokey.git
cd autokey
makepkg -sifc

The original problem:
I just upgraded Python from 3.11 to 3.12 (Arch Linux), and now Autokey fails to start:

$ autokey-gtk
Traceback (most recent call last):
  File "/usr/bin/autokey-gtk", line 5, in <module>
    from autokey.gtkui.__main__ import main
ModuleNotFoundError: No module named 'autokey'

I re-installed python-pyasyncore but it didn't help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted installation/configuration user support Requests for support - best handled on our forums
Projects
None yet
Development

No branches or pull requests

7 participants