GNU bug report logs - #71567
python tkinter library not found in guix shell

Previous Next

Package: guix;

Reported by: timotheemathieu <at> mailoo.org

Date: Sat, 15 Jun 2024 13:55:02 UTC

Severity: normal

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71567 in the body.
You can then email your comments to 71567 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#71567; Package guix. (Sat, 15 Jun 2024 13:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to timotheemathieu <at> mailoo.org:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sat, 15 Jun 2024 13:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: timotheemathieu <at> mailoo.org
To: bug-guix <at> gnu.org
Subject: python tkinter library not found in guix shell
Date: Sat, 15 Jun 2024 12:22:32 +0200 (CEST)
[Message part 1 (text/plain, inline)]
Hello,



I want to use guix shell for development environment with python, and more precisely, I want to usethe  tkinter library in python. 

According to https://issues.guix.gnu.org/20889 I believed that tkinter should be automatically included into python but when I launch 



guix shell -CN  python tk tcl -- python3 -m tkinter



I get



Traceback (most recent call last):
  File "/gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7/lib/python3.10/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'



whereas, python3 -m tkinter works perfectly well on the host OS (which is a foreign os, not guix-SD). I did a guix pull pretty recently, guix is up to date.



Is this a bug or is there a specific way to install python so that we get tkinter at the same time ? 



Thanks.


[Message part 2 (text/html, inline)]

Reply sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
You have taken responsibility. (Sun, 16 Jun 2024 14:10:02 GMT) Full text and rfc822 format available.

Notification sent to timotheemathieu <at> mailoo.org:
bug acknowledged by developer. (Sun, 16 Jun 2024 14:10:02 GMT) Full text and rfc822 format available.

Message #10 received at 71567-close <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: timotheemathieu <at> mailoo.org, 71567-close <at> debbugs.gnu.org
Subject: Re: bug#71567: python tkinter library not found in guix shell
Date: Sun, 16 Jun 2024 14:09:32 +0000
Hi Timothee,

On 15 June 2024 10:22:32 UTC, timotheemathieu--- via Bug reports for GNU Guix <bug-guix <at> gnu.org> wrote:
>According to https://issues.guix.gnu.org/20889 I believed that tkinter should be automatically included into python

Not quite.  Quoting Ludo' in that thread:

  "I think we should move tkinter*.so to a separate output of the Python packages"

And indeed:

  ~ λ guix show python
  name: python
  version: 3.10.7
  outputs:
  + tk: [description missing]
  + idle: [description missing]
  + out: everything else
  [...]

So there's no bug, you just never included tkinter in your environment when you thought you had.

Iinstead of

>guix shell -CN  python tk tcl -- python3 -m tkinter

try

  ~ λ guix shell -CN python{,:tk} -- python3 -m tkinter

'python{,:tk}' is bash shorthand that expands to 'python python:tk'.

I get a $DISPLAY error because this machine doesn't run X, but that implies success, right?



Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 15 Jul 2024 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.