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

Missing modules when running as root #5

Open
chambln opened this issue Nov 2, 2022 · 3 comments
Open

Missing modules when running as root #5

chambln opened this issue Nov 2, 2022 · 3 comments

Comments

@chambln
Copy link

chambln commented Nov 2, 2022

I can install and run xkalamine just fine as my regular user.

$ git clone https://github.com/qwerty-fr/kalamine
$ cd kalamine
$ poetry install
$ poetry run xkalamine
Usage: xkalamine [OPTIONS] COMMAND [ARGS]...
...

But then as root, the installed modules are not available.

# poetry run xkalamine
Traceback (most recent call last):                                                   
  File "<string>", line 1, in <module>                                               
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module       
    return _bootstrap._gcd_import(name[level:], package, level)                      
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import                    
  ...
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed       
  File "/home/greg/src/kalamine/kalamine/__init__.py", line 2, in <module>                 
    from .layout import KeyboardLayout                                               
  File "/home/greg/src/kalamine/kalamine/layout.py", line 10, in <module>                  
    import yaml                                                                      
ModuleNotFoundError: No module named 'yaml'

The only way I can get layouts installed properly is by installing the dependencies as root using poetry

# poetry install
# poetry run xkalamine
Usage: xkalamine [OPTIONS] COMMAND [ARGS]...
...

which is not ideal. Root permissions are only really needed in order to modify the system's keyboard layout files, right? Maybe it's better to produce a diff which the user can then apply by running patch(1) as root, or produce a complete symbols file which can be installed using cp(1) or whatever as root.

@chambln
Copy link
Author

chambln commented Nov 3, 2022

Related: OneDeadKey#22 (draft PR: Install system-wide without running xkalamine as root)

@devnoname120
Copy link
Member

Can you try the recommendation of ChatGPT?

image

@devnoname120
Copy link
Member

devnoname120 commented Dec 9, 2022

@chambln Interestingly, it works just fine here:

image

Anyway, I don't think that this issue is related to https://github.com/qwerty-fr/kalamine, but it's more a question about how to use Poetry. I'll keep it open so that we can update the README.md file once we have a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants