mathoudebine / turing-smart-screen-python

Unofficial Python system monitor and library for small IPS USB-C displays like Turing Smart Screen or XuanFang
GNU General Public License v3.0
1.16k stars 193 forks source link

tkinter error on windows 11 #590

Open figurenine opened 1 month ago

figurenine commented 1 month ago

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

mathoudebine commented 3 weeks ago

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

AskoPuu commented 1 week ago

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

mathoudebine commented 1 week ago

Can you try this change in configure.py? Please replace these lines: https://github.com/mathoudebine/turing-smart-screen-python/blob/4ca1f5ffe49dc3deafee210498294749f95d19ec/configure.py#L36-L46 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 commented 1 week ago

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.