idle glitch while building python 3.4 from sources

M

Mark H Harris

hi folks, I got bit again trying to build python3.4 from sources (mea
culpa, of course). The symptom is everything (except ensure pip) builds,
installs, and runs fine with the small baby problem that IDLE will not
run (-tkinter isn't even there) even though tcl/tk 8.5 is loaded and
running.

This happens to me from time to time when I'm building on a new machine
(this one is a T-61 ThinkPad running Mint Maya). The solution is simple,
if I could remember it.

The dev packages for tcl/tk have to be installed or the python build
will not self-configure for tkinter. Make sure these are installed
before ./configure; make; sudo make install :

tcl8.5-dev
tk8.5-dev

That is assuming that the dev packages (as well as tcl/tk) are installed
to the standard places on my distro (they were). We can point the build
at another location in setup.py, or with ./configure options, or with
make options (complicated).

Why am I posting? Glad you asked. I am wondering if the build scripts
could be updated slightly by prompting the user for IDLE preferences;
and|or by being more robust about determining where tcl/tk lives, and|or
by explicitly telling the user in the logs (or preferably right there
on-screen) that the dev header packages for tcl/tk are not installed,
and|or by refusing to build until the tcl/tk dev packages are installed,
and|or refusing to build unless the user explicitly opts to bypass
tkinter and build python anyway.

I know its my own fault (because I should just know this) but I got to
wondering about others who 'might not know' about the tcl/tk dev
packages and would be scratching their heads about why _tkinter is
missing and IDLE won't run, although tcl/tk is installed correctly and
running?

Just a suggestion...


marcus
 
N

Ned Deily

I know its my own fault (because I should just know this) but I got to
wondering about others who 'might not know' about the tcl/tk dev
packages and would be scratching their heads about why _tkinter is
missing and IDLE won't run, although tcl/tk is installed correctly and
running?

If the Python build (the "make sharedmods" build step) can't
successfully build the _tkinter extension module (because, for example,
it couldn't find the Tk headers or libraries), the build step already
reports that it could not build _tkinter. It does the same for all of
the other extension module builds, some of which also require
third-party headers and libraries, like those from OpenSSL, zlib, bz2,
etc. Also, most people don't build Python from source - they install
Python from a distributor - and the people who do generally know (or
learn quickly) what dependencies are needed for their needs.
 
M

Mark H Harris

If the Python build (the "make sharedmods" build step) can't
successfully build the _tkinter extension module (because, for example,
it couldn't find the Tk headers or libraries), the build step already
reports that it could not build _tkinter.

hi Ned, where is the report? Its not obvious; where does one look for
this step output? I did not see it on my build attempts last night. I'm
assuming its in one of the logs. What would be nice is a final (at the
end) report listing of the modules|extention modules that did not get
built (for whatever reason).

As an aside, the ensure pip is disabled for some reason (I'm reading the
pep, and such, which is confusing). There isn't much to go on from the
build listing about ensure pip either.


marcus
 
M

Mark H Harris

If the Python build (the "make sharedmods" build step) can't
successfully build the _tkinter extension module (because, for example,
it couldn't find the Tk headers or libraries), the build step already
reports that it could not build _tkinter.

hi Ned, where is the report? Its not obvious; where does one look for
this step output? I did not see it on my build attempts last night. I'm
assuming its in one of the logs. What would be nice is a final (at the
end) report listing of the modules|extention modules that did not get
built (for whatever reason).

As an aside, the ensure pip is disabled for some reason (I'm reading the
pep, and such, which is confusing). There isn't much to go on from the
build listing about ensure pip either.


marcus
 
N

Ned Deily

Mark H Harris said:
hi Ned, where is the report? Its not obvious; where does one look for
this step output? I did not see it on my build attempts last night. I'm
assuming its in one of the logs. What would be nice is a final (at the
end) report listing of the modules|extention modules that did not get
built (for whatever reason).

$ sudo aptitude remove tk-dev tcl-dev
$ make clean
$ make
gcc -pthread -c -fno-strict-aliasing -g -O2 -g -O0 -Wall
-Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o
Modules/python.o ./Modules/python.c
[...]
../python -E -S -m sysconfig --generate-posix-vars
[20560 refs]
running build
running build_ext
building dbm using gdbm
INFO: Can't locate Tcl/Tk libs and/or headers
[...]

Python build finished, but the necessary bits to build these modules
were not found:
_bsddb _tkinter bsddb185
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the
module's name.

running build_scripts
$
As an aside, the ensure pip is disabled for some reason (I'm reading the
pep, and such, which is confusing). There isn't much to go on from the
build listing about ensure pip either.

What do you mean by "disabled"? Are you building from a source tarball
or from some package from your distribution? You'll need to do a "make
install" for pip to be installed and it will be installed in your
--prefix bin (default, /usr/local/bin) as pip3 and pip3.4.
 
K

kfsone

I just upgraded to Python 3.4.1 AMD64 for Windows 7 using the binaries, and this appears to have affected the Windows binary distribution.

osmith@WOTSIT /c/Python34/Lib/idlelib
$ python idle.py
** IDLE can't import Tkinter. Your Python may not be configured for Tk. **
 
T

Terry Reedy

I just upgraded to Python 3.4.1 AMD64 for Windows 7 using the binaries,

Upgraded from what to what with what? Which binaries? Details matter.
and this appears to have affected the Windows binary distribution.
osmith@WOTSIT /c/Python34/Lib/idlelib
$ python idle.py
** IDLE can't import Tkinter. Your Python may not be configured for Tk. **

Try idle.bat
 

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
474,056
Messages
2,570,440
Members
47,101
Latest member
DoloresHol

Latest Threads

Top