Issue 3881: IDLE won't start in custom directory. (original) (raw)

Issue3881

Created on 2008-09-16 13:47 by kimsey0, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
symlink.diff loewis,2009-01-22 15:48
Messages (28)
msg73301 - (view) Author: Jacob Bundgaard (kimsey0) * Date: 2008-09-16 13:47
Hello. I run Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) on Windows Vista Home Premium. IDLE won't start if not installed in the default directory. When insalled in a custom directory, running idle.py (\Lib\idlelib\idle.py) produces this error: "Traceback (most recent call last): File "C:\Programmer\Python\lib\idlelib\idle.py", line 21, in idlelib.PyShell.main() File "C:\Programmer\Python\lib\idlelib\PyShell.py", line 1390, in main root= Tk(className="Idle") File "C:\Programmer\Python\lib\idlelib\Tkinter.py", line 1636, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: Can't find a usable init.tcl in the following directories: {C:\Programmer\Python\tcl\tcl8.4} {C:\Programmer\Python\tcl\tcl8.4} C:/Programmer/Python/tcl/tcl8.4 C:/Programmer/Python/lib/tcl8.4 C:/Programmer/Python/lib/tcl8.4 C:/lib/tcl8.4 C:/library C:/tcl8.4/library This probable means that Tcl wasn't installed properly."
msg73315 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-09-16 21:22
Do you have TCL_DIR or TK_DIR environment variables set?
msg73316 - (view) Author: Jacob Bundgaard (kimsey0) * Date: 2008-09-16 21:26
No, nothing. It's just a standart clean installation.
msg80027 - (view) Author: Zlm (zlm) Date: 2009-01-17 17:36
Hi. I have the same problem, but i'm running Pyhton 2.6.1. I'm using Windows Vista 32bit SP1. I installed Python to C:\Program Files\Python\2.6\ and when I try to run idle from the start menu, it doesn't work. When I try to run it from the command line, the same error is displayed: "C:\Program Files\Python\2.6\Lib\idlelib>python idle.py Traceback (most recent call last): File "idle.py", line 21, in idlelib.PyShell.main() File "C:\Programas\Python\2.6\lib\idlelib\PyShell.py", line 1386, in main root = Tk(className="Idle") File "C:\Programas\Python\2.6\lib\lib-tk\Tkinter.py", line 1643, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, want objects, useTk, sync, use) _tkinter.TclError: Can't find a usable init.tcl in the following directories: {C:\Programas\Python\2.6\tcl\tcl8.5} C:/Programas/Python/2.6/lib/tcl8.5 C:/P rogramas/Python/lib/tcl8.5 C:/Programas/lib/tcl8.5 C:/Programas/Python/library C :/Programas/library C:/Programas/tcl8.5.2/library C:/tcl8.5.2/library This probably means that Tcl wasn't installed properly."
msg80032 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-17 18:08
zlm, did you chose to install Tcl/Tk when installing Python?
msg80033 - (view) Author: Zlm (zlm) Date: 2009-01-17 18:12
Yes, I did.
msg80034 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-17 18:30
> Yes, I did. So do you have a file C:\Programas\Python\2.6\tcl\tcl8.5\init.tcl ?
msg80035 - (view) Author: Zlm (zlm) Date: 2009-01-17 18:43
> So do you have a file C:\Programas\Python\2.6\tcl\tcl8.5\init.tcl ? Yes, I have. Could this problem be related to paths with slashes and backslashes? In the error log, the first path (the right one) has backslashes, but the others have slashes. " {C:\Programas\Python\2.6\tcl\tcl8.5} C:/Programas/Python/2.6/lib/tcl8.5 C:/P rogramas/Python/lib/tcl8.5 C:/Programas/lib/tcl8.5 C:/Programas/Python/library C :/Programas/library C:/Programas/tcl8.5.2/library C:/tcl8.5.2/library"
msg80036 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-17 18:50
> Could this problem be related to paths with slashes and backslashes? Unlikely. The exact same package works on many other machines, so there must be something strange with your machine. Can you run the Sysinternals filemon to find out what files it is accessing?
msg80038 - (view) Author: Jacob Bundgaard (kimsey0) * Date: 2009-01-17 19:15
I don't think it's just his machine (and mine), but i don't think so. Unfortunealy, i don't have a Windows Vista key ready, else i'd have testet it on a clean install, but i'll try to install the same package on the next computer with Vista i stumple upon.
msg80039 - (view) Author: Zlm (zlm) Date: 2009-01-17 19:39
> Can you run the Sysinternals filemon to find out what files it is accessing? I tried Sysinternals ProcessMonitor (equivalent of filemon to Windows Vista), but the simple act of trying to open IDLE produces thousands of entries to the log window. I also don't think this is a problem of my machine, because i'm not the only one with this problem. I think this situation can be easily reproduced by installing Pyhton to other than the default path on Windows Vista.
msg80041 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-17 20:03
> I think this situation can be easily > reproduced by installing Pyhton to other than the default path on > Windows Vista. I could not reproduce it that way. I just installed Python 2.6.1 into c:\tmp\python26, on Vista SP1 x64 (although I installed the 32-bit version of Python), and IDLE works just fine.
msg80043 - (view) Author: Jacob Bundgaard (kimsey0) * Date: 2009-01-17 20:39
Okay, i'll try to find a key for Vista in all my drawers, and install a clean version, try it, and then i'll tell you the result. I just can't see what could produce the error at our computers.
msg80082 - (view) Author: Gabriel Genellina (ggenellina) Date: 2009-01-18 09:42
> I installed Python to C:\Program Files\Python\2.6\ and when I try to > run idle from the start menu, it doesn't work. > "C:\Program Files\Python\2.6\Lib\idlelib>python idle.py > Traceback (most recent call last): > File "idle.py", line 21, in > idlelib.PyShell.main() > File "C:\Programas\Python\2.6\lib\idlelib\PyShell.py", line 1386, Note the TWO different paths: C:\Program Files\Python\2.6\ and C: \Programas\Python\2.6 Do you have a PYTHONPATH environment variable? Did you install twice, once per directory? Perhaps one of them without tcl support?
msg80102 - (view) Author: Jacob Bundgaard (kimsey0) * Date: 2009-01-18 14:06
I don't think thats the solution. "C:\Program Files\Python\2.6\" and "C:\Programas\Python\2.6\" are the same, as "C:\Program Files\Python\2.6\" is a symbolic link to "C:\Programas\Python\2.6\" to allow compatibility with different operation system languages.
msg80110 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-18 17:53
> I don't think thats the solution. > "C:\Program Files\Python\2.6\" and > "C:\Programas\Python\2.6\" > are the same, as "C:\Program Files\Python\2.6\" is a symbolic link to > "C:\Programas\Python\2.6\" to allow compatibility with different > operation system languages. It could be a hint to the problem, though. Jacob: what language version is your Vista installation? Is "c:\Programmer" the local translation of "c:\Program Files"? Perhaps something doesn't work right with symbolic links on Vista. Unfortunately, I have only the English version of Vista for testing. Can you two please install Python into a non-standard folder that isn't a symbolic link?
msg80114 - (view) Author: Jacob Bundgaard (kimsey0) * Date: 2009-01-18 19:02
Great idea :) Maybe we're starting to find the problem. I'm using a Danish version of Windows Vista Home Premium SP1, and C:\Programmer is the danish path for C:\Program Files. I'll try that, and leave another message when i'we tried it.
msg80129 - (view) Author: Zlm (zlm) Date: 2009-01-18 21:51
"Programas" is the portuguese translation to "Program Files". I have just installed it to C:\Test\Python and IDLE is working! The problem should be related to the Vista symbolic links.
msg80131 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-18 21:55
> The problem should be related to the Vista symbolic links. Unfortunately, it isn't as simple as "install into a symbolic link, and it fails". I created c:\temp -> c:\tmp, and installed into c:\temp (i.e. into the symlink), and it still worked fine.
msg80146 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-01-19 02:34
Maybe it's "install into a symbolic link pointing to a path with spaces in it, and idle fails"?
msg80189 - (view) Author: Zlm (zlm) Date: 2009-01-19 16:25
I reinstalled Python to "C:\Program Files\Python\" (I wrote this path in the installer) and IDLE works fine. I can access the Python folder by going to "C:\Programas\Python". Then, I unninstalled and installed again to "C:\Programas\Python". IDLE doesn't work. I can still access the Python folder by going to "C:\Programas\Python". Jacob, can you try installing it to "C:\Program Files\Python" to sse if that works?
msg80259 - (view) Author: Jacob Bundgaard (kimsey0) * Date: 2009-01-20 16:24
Installing to C:\Program Files\Python\ worked. Now we just have to find out WHY it doesn't work with the C:\[Programmer/Programmas]\ to C:\Program Files\ link.
msg80278 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-20 20:59
> Installing to C:\Program Files\Python\ worked. > Now we just have to find out WHY it doesn't work with the > C:\[Programmer/Programmas]\ to C:\Program Files\ link. With process monitor, I made partial progress (after installing the German Vista version). It looks like that there is an explicit Deny ACL entry for read for Everyone in the Programme symlink. As a consequence, os.listdir(r"c:\programme") fails, even though os.listdir(r"c:\program files") succeeds. It looks like Tcl wants to list the contents of the symlink (I'm not yet sure why), and that this fails (ACCESS_DENIED).
msg80369 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-22 15:48
Here is a patch that should fix the problem. It uses Vista's GetFinalPathNameByHandleW to expand symbolic links before passing the path to Tcl.
msg80376 - (view) Author: Jacob Bundgaard (kimsey0) * Date: 2009-01-22 20:51
Fantastic. I started this post in October, and now we finaly found a solution. Thank you Martin. Will this patch be included in future versions of python? Best regards, Jacob.
msg80420 - (view) Author: Zlm (zlm) Date: 2009-01-23 21:32
I got my problem fixed in 4 days! Thank you for all your help, Martin!
msg80459 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-24 16:27
Committed as r68893, r68894, r68898, r68901.
msg95331 - (view) Author: Gabriel Genellina (ggenellina) Date: 2009-11-16 08:59
This patch had unintended consequences; see #6906
History
Date User Action Args
2022-04-11 14:56:39 admin set github: 48131
2009-11-16 08:59:08 ggenellina set messages: +
2009-11-04 21:33:44 srid set nosy: + srid
2009-01-24 16:27:07 loewis set status: open -> closedresolution: fixedmessages: +
2009-01-23 21:32:15 zlm set messages: +
2009-01-22 20:51:52 kimsey0 set messages: +
2009-01-22 15:48:48 loewis set versions: + Python 2.6, Python 3.0, Python 3.1, Python 2.7, - Python 2.5
2009-01-22 15:48:33 loewis set files: + symlink.diffkeywords: + patchmessages: +
2009-01-20 20:59:53 loewis set messages: +
2009-01-20 16:24:33 kimsey0 set messages: +
2009-01-19 16:25:31 zlm set messages: +
2009-01-19 02:34:22 ajaksu2 set nosy: + ajaksu2messages: +
2009-01-18 21:55:24 loewis set messages: +
2009-01-18 21:51:24 zlm set messages: +
2009-01-18 19:02:11 kimsey0 set messages: +
2009-01-18 17:53:11 loewis set messages: +
2009-01-18 14:06:17 kimsey0 set messages: +
2009-01-18 09:42:24 ggenellina set nosy: + ggenellinamessages: +
2009-01-17 20:39:53 kimsey0 set messages: +
2009-01-17 20:03:38 loewis set messages: +
2009-01-17 19:39:26 zlm set messages: +
2009-01-17 19:16:00 kimsey0 set messages: +
2009-01-17 18:50:54 loewis set messages: +
2009-01-17 18:43:28 zlm set messages: +
2009-01-17 18:30:37 loewis set messages: +
2009-01-17 18:12:22 zlm set messages: +
2009-01-17 18:08:13 loewis set messages: +
2009-01-17 17:36:40 zlm set nosy: + zlmmessages: +
2008-09-16 21:26:25 kimsey0 set messages: +
2008-09-16 21:22:25 loewis set nosy: + loewismessages: +
2008-09-16 13:47:38 kimsey0 create