Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tkinter error on windows 11 #590

Open
figurenine opened this issue Oct 20, 2024 · 5 comments
Open

tkinter error on windows 11 #590

figurenine opened this issue Oct 20, 2024 · 5 comments
Labels
bug Something isn't working Python 13 Issue will be resolved when Python 13 is supported

Comments

@figurenine
Copy link

Tkinter appears to be installed correctly, but I can't run

python.exe .\configure.py

Screenshot 2024-10-20 152010
Screenshot 2024-10-20 151956
Screenshot 2024-10-20 151849

@figurenine figurenine added the bug Something isn't working label Oct 20, 2024
@mathoudebine
Copy link
Owner

Hi @figurenine
Tkinter seems to be installed, I think the error message is erroneous and indicate an issue with another dependency.
I see you are using Python 13. I did not check the compatibility of this project with Python 13 for now so it is recommended to use Python 12 that you can download here python.org/downloads/release/python-3127

@mathoudebine mathoudebine added the Python 13 Issue will be resolved when Python 13 is supported label Oct 30, 2024
@AskoPuu
Copy link

AskoPuu commented Nov 10, 2024

I have the same problem, i tried with Python 3.12.7. I confirmed Tinker is installed.

@mathoudebine
Copy link
Owner

Can you try this change in configure.py?
Please replace these lines:

try:
import tkinter.ttk as ttk
from tkinter import *
from PIL import ImageTk
except:
print(
"[ERROR] Tkinter dependency not installed. Please follow troubleshooting page: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Troubleshooting#all-os-tkinter-dependency-not-installed")
try:
sys.exit(0)
except:
os._exit(0)

by:

 import tkinter.ttk as ttk 
 from tkinter import * 
 from PIL import ImageTk 

(be careful there is one blank space at the beginning of each line)
It should display a different error message that you can then post here

@AskoPuu
Copy link

AskoPuu commented Nov 15, 2024

Now it actually loads the configure window (didn't previously).

Windows is saying (to my understanding) that the files are untrusted. I unblocked most of the libre-files, and it continue but nothing shows in the screen.

C:\Users\Administrator\Documents\turing-smart-screen-python-3.5.0>15.11.2024 14.16.44 [INFO] Loading theme 5inchTheme2Radial from res/themes/5inchTheme2Radial/theme.yaml
15.11.2024 14.16.44 [DEBUG] HW revision: C
15.11.2024 14.16.44 [DEBUG] Static COM port: COM3
System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\Administrator\Documents\turing-smart-screen-python-3.5.0\main.py", line 64, in
import library.scheduler as scheduler
File "C:\Users\Administrator\Documents\turing-smart-screen-python-3.5.0\library\scheduler.py", line 28, in
import library.stats as stats
File "C:\Users\Administrator\Documents\turing-smart-screen-python-3.5.0\library\stats.py", line 67, in
import library.sensors.sensors_librehardwaremonitor as sensors
File "C:\Users\Administrator\Documents\turing-smart-screen-python-3.5.0\library\sensors\sensors_librehardwaremonitor.py", line 40, in
clr.AddReference(lhm_dll)
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Administrator\Documents\turing-smart-screen-python-3.5.0\external\LibreHardwareMonitor\LibreHardwareMonitorLib.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Administrator\Documents\turing-smart-screen-python-3.5.0\external\LibreHardwareMonitor\LibreHardwareMonitorLib.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Python.Runtime.AssemblyManager.LoadAssemblyFullPath(String name)
at Python.Runtime.CLRModule.AddReference(String name)

E: woop,woop,wooooop... Got it working, i used wrong display lol. Tried the default one but my monitor wouldnt support it.

@AoXNeR
Copy link

AoXNeR commented Dec 10, 2024

Can you try this change in configure.py? Please replace these lines:

try:
import tkinter.ttk as ttk
from tkinter import *
from PIL import ImageTk
except:
print(
"[ERROR] Tkinter dependency not installed. Please follow troubleshooting page: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Troubleshooting#all-os-tkinter-dependency-not-installed")
try:
sys.exit(0)
except:
os._exit(0)

by:

 import tkinter.ttk as ttk 
 from tkinter import * 
 from PIL import ImageTk 

(be careful there is one blank space at the beginning of each line) It should display a different error message that you can then post here

hi,
tried this edit,
new error is: ModuleNotFoundError: No module named 'PIL'
after installing Pillow, the new error is:
[ERROR] Python dependencies not installed.

SOLUTION:
-Install Python 12 from your link
-Install Pillow (python3 -m pip install Pillow)
-Install dependencies (tutorial)
-Run configure.py

Fixed the issues for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python 13 Issue will be resolved when Python 13 is supported
Projects
None yet
Development

No branches or pull requests

4 participants