How, python with Tk extensions enabled to import Tkinter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Murat Gunduz

    How, python with Tk extensions enabled to import Tkinter



    Dear list member,

    I am using a Linux machine (Fedora Core 7, 64 bit):
    Linux 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12 14:56:37 EDT 2007 x86_64

    I tried to compile a software (ncvtk) with the simple command below

    % python setup.py install

    ERROR: could not import Tkinter.
    You need python with Tk extensions enabled.
    Check http://python.org.
    Tcl/Tk libraries can be found at http://tcl.sourceforge.net/.


    As the information said, I need a Python with Tk extensions enabled.
    However, I could not figure out how to compile python with Tk extension,
    I tried:

    1- get the source codel tcl.8.5.1 and install
    2- get the source code tk.8.5.1 and install
    3- get the Python-2.5.2 source code and "cd Python-2.5.2"
    4- type "./configure --enable-framework
    5- make

    gives the below error

    =============== =============== ==========
    gcc -pthread -c -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g
    -fwrapv
    -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -fPIC
    -DPy_BUILD_CORE
    -DPYTHONPATH='": plat-linux2:lib-tk"' \
    -DPREFIX='"/Library/Frameworks/Python.framewor k/Versions/2.5"'
    \

    -DEXEC_PREFIX='"/Library/Frameworks/Python.framewor k/Versions/2.5"' \
    -DVERSION='"2.5" ' \
    -DVPATH='""' \
    -o Modules/getpath.o ./Modules/getpath.c
    ../Modules/getpath.c: In function ?calculate_path ?:
    ../Modules/getpath.c:386: error: ?NSModule? undeclared (first use in this
    function)
    ../Modules/getpath.c:386: error: (Each undeclared identifier is reported only
    once
    ../Modules/getpath.c:386: error: for each function it appears in.)
    ../Modules/getpath.c:386: error: expected ?;? before ?pythonModule?
    ../Modules/getpath.c:455: error: ?pythonModule? undeclared (first use in this
    function)
    ../Modules/getpath.c:455: warning: implicit declaration of function
    ?NSModuleForSym bol?
    ../Modules/getpath.c:455: warning: implicit declaration of function
    ?NSLookupAndBin dSymbol?
    ../Modules/getpath.c:457: warning: implicit declaration of function
    ?NSLibraryNameF orModule?
    ../Modules/getpath.c:457: warning: cast to pointer from integer of different
    size
    make: *** [Modules/getpath.o] Error 1
    =============== =============== ===========


    Could you please help, how should I configure Python to enable Tk extension.

    Thank you very much in advance,
    Murat

Working...