Closed bigheadming closed 1 month ago
Is your windows 32bit or 64bit?
Edition: Windows 11 Home System Type: 64-bit operating system, x64-based processor
Strange...
Refer to https://learn.microsoft.com/en-us/windows/win32/winprog64/registry-redirector
Redirected keys are mapped to physical locations under Wow6432Node. For example, HKEY_LOCAL_MACHINE\Software is redirected to HKEY_LOCAL_MACHINE\Software\Wow6432Node. However, the physical location of redirected keys should be considered reserved by the system. Applications should not access a key's physical location directly, because this location may change. For more information, see Accessing an Alternate Registry View.
SOFTWARE\Microsoft
should be a alias of SOFTWARE\WOW6432Node\Microsoft
.
I think the most likely problem is the order of three browsers. Please check if Chrome or Firefox's registry key exist but no binary located at the key's value.
This bug was reported a while ago. Over the time, I uninstalled Chrome but I still have Firefox and Brave. I can find both brave.exe and frefox.exe in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ in the registry. In both the value of (Default) key is C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe and C:\Program Files\Mozilla Firefox\firefox.exe respectively. I verified that both exe files exist in their paths.
Brave is my primary browser. You mentioned that it may be "the order of three browsers". What's needed to do without hacking into chrome_converter.py?
Hope this is what you asked. Thanks.
I realize that you change the order of three browsers in your solution. So I think it may not a problem with WOW6432Node
path in registry but system find chrome.exe
path first but it does not work.
# Succeeded after hacking into dataframe_image\converter\browser\chrome_converter.py
# and the changed the followings:
# locs = [
# r"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\brave.exe",
# r"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe",
# r"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe",
# # r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe",
# # r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe",
# # r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\brave.exe",
# ]
If the problem is the order. There are two solutions:
chrome_path
parameter. like this:
dfi.export(xxx_styled, 'c:\\Temp\\xxx.png') , chrome_path="your/path/of/brave.exe"
Since I don't have Chrome installed, I can't uninstall it. Here are what I've tried:
dfi.export(xxx_styled, 'c:\Temp\xxx.png') failed with the following error:
File c:\Users\xxx\miniconda3\envs\py311_ml\Lib\site-packages\dataframe_image\converter\browser\chrome_converter.py:70, in get_chrome_path(chrome_path) 64 locs = [ 65 r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe", 66 r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe", 67 r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\brave.exe", 68 ] 69 for loc in locs: ---> 70 handle = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, loc) 71 num_values = winreg.QueryInfoKey(handle)[1] 72 if num_values > 0:
FileNotFoundError: [WinError 2] The system cannot find the file specified
dfi.export(xxx_styled, 'c:\Temp\xxx.png', chrome_path="C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe" ) was run successfully.
Use another Windows 11 64bit machine with Chrome installed
dfi.export(xxx_styled, 'c:\Temp\xxx.png') was run successfully.
So, it seems that one needs to specify chrome_path if Chrome is not installed, even if a Chrome-based browser like msedge.exe and brave.exe is available and is shown in the locs list in package code "chrome_converter.py:70":
locs = [ r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe", r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe", r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\brave.exe", ]
Is it supposed that chrome_converter.py would use the next one in the locs if the current one can't be found? I am trying to see if one can avoid specifying chrome_path.
Overall, it works now with update to 0.2.5 and specfy chrome_path if the windows machine don't have chrome installed.
Can you install latest source from github and test does it works without specific chrome path?
Using the source from github, It works now even without specifying chrome_path and without having chrome.exe installed. (In my case, I have brave.exe installed in my machine.)
dfi.export(xxx_styled, 'c:\Temp\xxx.png')
Thank you for the fix!
OS: Windows 11 Home OS Version: 23H2 Python: 3.9.18 Chrome installed: No Brave installed: Yes
Description:
Code: