How, python with Tk extensions enabled to import Tkinter

M

Murat Gunduz

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.framework/Versions/2.5"'
\

-DEXEC_PREFIX='"/Library/Frameworks/Python.framework/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
?NSModuleForSymbol?
../Modules/getpath.c:455: warning: implicit declaration of function
?NSLookupAndBindSymbol?
../Modules/getpath.c:457: warning: implicit declaration of function
?NSLibraryNameForModule?
../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
 
D

Diez B. Roggisch

Murat said:
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

So you are under linux...
4- type "./configure --enable-framework

And now you try to create an OSX-framework-build? Why so, what made you
think that's working?

The missing NS*-class-reference is a sign of the build-process being
confused, because NS* is the class-namespace of OSX for objective-C.

Try the configure without the --enable-framework.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top