coolcoolad / pythonxy

Automatically exported from code.google.com/p/pythonxy
0 stars 0 forks source link

Win 7 64-bit: when running xyhome.pyw console shows "KeyError: 'DocPath' and no Python(x,y) panel #461

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If relevant, please answer to the following questions:
1. What version of Python(x,y) have you installed?
Python(x,y) 2.7.2.3
2. Which components have you installed (Python(x,y) installer: component
page):
    a. Have you selected the "Recommended" component selection?
YES
    b. Have you selected the "Full" component selection?
NO
c. Have you selected manually plugins in the component list? What
plugins?
NO
3. Have you selected the option "Customize installation directories"?
a. Yes
b. No
YES
4. If the answer to 3. is yes, what installation directories have you
chosen?
C:\pythonxy
5. Where did you install Python(x,y) itself?
a. default path
b. custom path, which one?
6. Have you installed Python(x,y):
    a. For "Current user only"
    b. For "All users"
For 'CUREENT USER ONLY'
7. What is your operating system?
a. Windows XP
b. Windows Vista
c. Windows 7
Windows 7
8. Is the operating system 64 bit?
a. Yes
b. No
Yes
9. When you installed Python(x,y), were you logged in as :
a. a regular user
b. an administrator of the machine
10. If you are using Windows Vista/7, have you installed Python(x,y):
a. simply by double-clicking on the installer
    b. by right-clicking on the installer and selecting "Run as an
administrator"
Double-click
11. Regarding installed softwares on your machine, how did you clean your
machine before installing Python(x,y) (multiple answers are possible):
a. you didn't do anything, you installed Python(x,y) directly on your
machine without precaution
b. you uninstalled any previous Python distribution (including the
official .msi)
c. you cleaned the Windows registry by removing all Python-related keys
d. you cleaned the environment variables by removing all deprecated
entries

What steps will reproduce the problem?
1. Double click Python(x,y) icon on desktop
2. Nothing happens ...
3.

What is the expected output? What do you see instead?
Python(x,y) panel should come up

Please provide any additional information below.

1. When running xyhome.pyw manually, I get the following:

C:\Python27\Scripts>python xyhome.pyw
Traceback (most recent call last):
  File "xyhome.pyw", line 20, in <module>
    from xy import xyhome
  File "C:\Python27\lib\site-packages\xy\xyhome.pyw", line 28, in <module>
    from xy.config import (CONF, STARTUP_PATH, LOG_PATH, PLUGINS, XY_VERSION,
  File "C:\Python27\lib\site-packages\xy\config.py", line 123, in <module>
    DOC_PATH = REGXY['DocPath']
KeyError: 'DocPath'

C:\Python27\Scripts>

2. Looking at the C:\Python27\Lib\site-packages\xy\config.py file, I found 
(line 123 DOC_PATH = REGXY['DocPath'] ... where REGXY appears to be a 
Dictionary created by the call to 'getreg()' in the line above.

3. Looking at 'def getreg():' in line 47, I tried to manually replicate what is 
happening -- below is a trace:

>>> import sys, os, os.path as osp
>>> from _winreg import (OpenKey, EnumValue, QueryInfoKey, HKEY_CURRENT_USER, 
HKEY_LOCAL_MACHINE)
>>> key = "Software\Python(x,y)"
>>> regxy = dict()
>>> k = OpenKey(HKEY_LOCAL_MACHINE, key)
>>> k
<PyHKEY object at 0x01D4F1A0>
>>> for i in range(0, QueryInfoKey(k)[1]):
    j = EnumValue(k,i)
    print j

('Installer Language', u'1033', 1)
>>> QueryInfoKey(k)[1]
1

4. In particular, note that the query "OpenKey(KEY_LOCAL_MACHINE, key)" is 
successful (no WindowsError raised), even though I installed my software "for 
current user only". Further, it looks as if the k - the PyHKEY object - only 
contains 1 element: Installer Language.

5. When searching for the term "Installer Language" using RegEdit, I found the 
key in
 'Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python(x,y)
with the corresponding "Installer Language" set to 1033 - what 
QueryInfoKey(k)[1] returns above.

6. Apparently the Wow6432Node is a 'virtualized Registry node' - maybe only on 
64-bit systems? (Pushing my knowledge here :-)

7. Checking further, I ran the OpenKey query using HKEY_CURRENT_USER:

>>> kl = OpenKey(HKEY_CURRENT_USER, key)
>>> kl
<PyHKEY object at 0x01D4F1C0>
>>> QueryInfoKey(kl)[1]
7
>>> for i in range(0, QueryInfoKey(kl)[1]):
    j = EnumValue(kl,i)
    print j

('Start Menu Folder', u'Python(x,y)', 1)
('', u'C:\\pythonxy', 1)
('Version', u'2.7.2.3', 1)
('Python', u'C:\\Python27', 1)
('DocPath', u'C:\\pythonxy\\doc', 1)
('MinGW', u'C:\\MinGW32-xy', 1)
('SWIG', u'C:\\pythonxy\\swig', 1)
>>> 

8. With this query, I do see the expected Dictionary created ...

9. With this hint, I ended up modifying the 'config.py' file to FIRST check:
      k = OpenKEY(HKEY_CURRENT_USER, key)
then continue with the HKEY_LOCAL_MACHINE

This works for me now, although I'm sure there are better solutions ... but at 
least it is a place to start.

Original issue reported on code.google.com by AudunRu...@gmail.com on 27 Jun 2012 at 2:13

GoogleCodeExporter commented 8 years ago

Original comment by grizzly.nyo on 8 Jul 2012 at 3:42

GoogleCodeExporter commented 8 years ago
Same issue. What we have in common is I selected current user. We differ in the 
following:
    2b. Have you selected the "Full" component selection?
YES
3. Have you selected the option "Customize installation directories"?
a. Yes
b. No
NO

Original comment by gary...@gmail.com on 31 Aug 2012 at 6:28

GoogleCodeExporter commented 8 years ago
Same issue installing version 2.7.2.3 on Windows XP for one user only. The 
"getreg()" function in "\site-packages\xy\config.py" returns only {'Installer 
Language': u'1033'} from HKEY_LOCAL_MACHINE, not the keys in HKEY_CURRENT_USER, 
including "DocPath".

There are two languages installed (seen in the Language Bar) on this computer, 
perhaps that matters?

May I suggest that this issue gets bumped up to High Priority? Unless you dig 
into it a bit, the result is that Python(x,y) just fails to start without any 
error message. That should be enough to scare away new users.

Original comment by martin.g...@gmail.com on 10 Oct 2012 at 3:12

GoogleCodeExporter commented 8 years ago

Original comment by grizzly.nyo on 4 Nov 2012 at 4:35

GoogleCodeExporter commented 8 years ago
I had a similar problem on 32 bit Windows XP. I installed Python (x,y) for my 
user account but there was still a 'Python(x,y)' key in HKEY_LOCAL_MACHINE 
which I deleted to get Python(x,y) Home to work.

If you don't do this Python (x,y) opens the 'Python(x,y)' key in 
HKEY_LOCAL_MACHINE which is not what you want when you install it for your user 
name (although I don't know how it got to HKEY_LOCAL_MACHINE in the first 
place).

Original comment by chris.mu...@gmail.com on 8 Nov 2012 at 1:01