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

3.11 build reports missing _tkinter on Ubuntu 18.04 #98973

Closed
vient opened this issue Nov 1, 2022 · 13 comments
Closed

3.11 build reports missing _tkinter on Ubuntu 18.04 #98973

vient opened this issue Nov 1, 2022 · 13 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@vient
Copy link

vient commented Nov 1, 2022

Bug report

Python 3.11 build on Ubuntu 18.04 reports checking for stdlib extension module _tkinter... missing even if all necessary packages are installed. This does not happen on Ubuntu 20.04, the difference that I noticed is that 20.04 packages include .pc files for pkg-config while on 18.04 they are not.

Installed packages on 18.04:

ii  libtcl8.6:amd64                  8.6.8+dfsg-3                        amd64        Tcl (the Tool Command Language) v8.6 - run-time library files
ii  tcl                              8.6.0+9                             amd64        Tool Command Language (default version) - shell
ii  tcl-dev:amd64                    8.6.0+9                             amd64        Tool Command Language (default version) - development files
ii  tcl8.6                           8.6.8+dfsg-3                        amd64        Tcl (the Tool Command Language) v8.6 - shell
ii  tcl8.6-dev:amd64                 8.6.8+dfsg-3                        amd64        Tcl (the Tool Command Language) v8.6 - development files

# dpkg -l | grep tk
ii  libtk8.6:amd64                   8.6.8-4                             amd64        Tk toolkit for Tcl and X11 v8.6 - run-time files
ii  tk                               8.6.0+9                             amd64        Toolkit for Tcl and X11 (default version) - windowing shell
ii  tk-dev:amd64                     8.6.0+9                             amd64        Toolkit for Tcl and X11 (default version) - development files
ii  tk8.6                            8.6.8-4                             amd64        Tk toolkit for Tcl and X11 v8.6 - windowing shell
ii  tk8.6-blt2.5                     2.5.3+dfsg-4                        amd64        graphics extension library for Tcl/Tk - library
ii  tk8.6-dev:amd64                  8.6.8-4                             amd64        Tk toolkit for Tcl and X11 v8.6 - development files

Dockerfile, RUN ./configure eventually prints that _tkinter and _uuid are missing

FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /python
RUN apt update
RUN apt install --yes software-properties-common wget tar
RUN add-apt-repository --yes --update --enable-source ppa:deadsnakes
RUN apt-get build-dep --yes python3.11
RUN wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz
RUN tar xvf Python-3.11.0.tar.xz

WORKDIR /python/Python-3.11.0
RUN ./configure
ENTRYPOINT /bin/bash

Your environment

  • CPython versions tested on: 3.11.0
  • Operating system and architecture: Ubuntu 18.04.6 amd64
@vient vient added the type-bug An unexpected behavior, bug, or error label Nov 1, 2022
@vient
Copy link
Author

vient commented Nov 1, 2022

I know that this procedure is not the same as in building guide. I tried to perform steps listed there (edit sources.list, install all mentioned packages), and while _uuid did appear, _tkinter is still reported as missing.

@asottile
Copy link
Contributor

asottile commented Nov 3, 2022

this was due to #31698 -- here's (for example) what deadsnakes does since 18.04 is missing pkg-config information for tkinter: https://github.com/deadsnakes/python3.11/compare/c02751ae7c8c560482523821a221deec09bb2bcb%5E..58af40341824bce58f9d6533e368440c82ce6dc3

@vient
Copy link
Author

vient commented Nov 3, 2022

deadsnakes version reports checking for stdlib extension module _tkinter... missing too though

@vient
Copy link
Author

vient commented Nov 3, 2022

Oh, ok, they have changes in deb scripts, and I am trying to build with make directly.

@asottile
Copy link
Contributor

asottile commented Nov 3, 2022

no it doesn't?

$ python3.11 -c 'import _tkinter'
$

@vient
Copy link
Author

vient commented Nov 4, 2022

I tried TCLTK_CFLAGS="-I/usr/include/tcl8.6" TCLTK_LIBS="-ltcl8.6" ./configure ..., it did not help, configure still reports that libs for tkinter are missing. I guess it's me who is missing something but I can't understand yet what is wrong.

@asottile
Copy link
Contributor

asottile commented Nov 4, 2022

that's not the same as my diff above shows

@vient
Copy link
Author

vient commented Nov 4, 2022

Hm, I took it from your diff
in debian/rules variables are set

TCLTK_CFLAGS=-I/usr/include/tcl8.6
TCLTK_LIBS=-ltcl8.6 -ltk8.6

and then passed to configure like this TCLTK_CFLAGS="$(TCLTK_CFLAGS)" TCLTK_LIBS="$(TCLTK_LIBS)" ../configure ... - is it different from what I am doing?

@vient
Copy link
Author

vient commented Nov 4, 2022

oh well i missed -ltk8.6

@vient
Copy link
Author

vient commented Nov 4, 2022

Yay, it worked, thanks for pointing to deadsnakes patches.
I don't know if this issue is relevant to CPython or not, what do they say about build support on 18.04? Did not see this information. Not closing just in case.

@asottile
Copy link
Contributor

asottile commented Nov 4, 2022

I asked about this when the pkg-config change landed (linked above) -- this is intentional that they no longer support platforms missing proper pkg-config for tkinter

@vient
Copy link
Author

vient commented Nov 4, 2022

So WONTFIX then, understood, thanks

@vient vient closed this as completed Nov 4, 2022
@StefaE
Copy link

StefaE commented Jan 1, 2023

On Debian/buster (old, ok ...), I needed to say TCLTK_LIBS="-ltk8.6 -ltkstub8.6 -ltcl8.6" TCLTK_CFLAGS="-I/usr/include/tcl8.6" ./configure ..., which took me a while to figure out ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants