Why doesn't tkinter import on CentOs 7

前端 未结 4 1870
孤独总比滥情好
孤独总比滥情好 2021-01-24 21:29

I have the python3-tkinter installed, as shown below:

$ sudo yum install python3-tkinter
[sudo] password for abigail: 
Loaded plugins: fastestmirror, langpacks
L         


        
相关标签:
4条回答
  • 2021-01-24 22:05

    You have both IUS and nux-desktop repos enabled. It appears that nux-desktop has a package named python3 of version 3.3.2, with the related python3-tkinter package. IUS on the other hand has packages for python34u (3.4.6), python35u (3.5.3), and python36u (3.6.0), all with corresponding tkinter packages. So if you want to be able to import tkinter inside a python3.5 REPL, then run:

    yum install python35u-tkinter
    
    0 讨论(0)
  • 2021-01-24 22:07

    For Python 3.6.x on CentOS 7.4, install:

    $ sudo yum install python36-tkinter
    

    You need to have EPEL repository configured.

    0 讨论(0)
  • 2021-01-24 22:10

    For centos 7.6, python 3.4.9, resolve my issue by:

    yum install python34-tkinter.x86_64

    0 讨论(0)
  • 2021-01-24 22:23

    For tkinter installation for Python3.5:

    1. yum -y install tkinter tcl-devel tk-devel
    2. vim ......./Python3.5.#/Modules/Setup.dist, remove the comment symbol before the following lines:

      _tkinter _tkinter.c tkappinit.c - -L/usr/local/lib \ -I/usr/local/include \ -ltk8.5 -ltcl8.5 \ #defualt as 8.2 -lX11

    3. configure and install

      ./configure make make install

    0 讨论(0)
提交回复
热议问题