turing-smart-screen-python icon indicating copy to clipboard operation
turing-smart-screen-python copied to clipboard

Configure.py / main.py cannot be run from another folder

Open pingyaru opened this issue 2 years ago • 2 comments

Problem
I was trying to make step 4 "Configure system monitor" in the "how to start" guide, but it won't start. I was using C:\Users\Sergey\AppData\Local\Programs\Python\Python311\python.exe "D:\small programs\turing-smart-screen-python-3.3.3\configure.py" command to run configure.py. I also tried to run cmd as and administrator.

Screenshot 2023-10-12 215912

C:\Windows\System32>C:\Users\Sergey\AppData\Local\Programs\Python\Python311\python.exe "D:\small programs\turing-smart-screen-python-3.3.3\configure.py" Traceback (most recent call last): File "D:\small programs\turing-smart-screen-python-3.3.3\configure.py", line 434, in <module> configurator = TuringConfigWindow() ^^^^^^^^^^^^^^^^^^^^ File "D:\small programs\turing-smart-screen-python-3.3.3\configure.py", line 148, in __init__ self.window.iconphoto(True, PhotoImage(file="res/icons/monitor-icon-17865/64.png")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Sergey\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 4125, in __init__ Image.__init__(self, 'photo', name, cnf, master, **kw) File "C:\Users\Sergey\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 4072, in __init__ self.tk.call(('image', 'create', imgtype, name,) + options) _tkinter.TclError: couldn't open "res/icons/monitor-icon-17865/64.png": no such file or directory

I made path to 64.png absolute in configure.py but next it said there was a problem with path to config.yaml. I cound't solve it, so I decided to open an issue

Screenshot 2023-10-12 215947

Environment:

  • Smart screen model: XuanFang 3.5" Revision flagship
  • OS with version: Windows 11
  • Python version: Python 3.11
  • Hardware: gigabyte b760 ds3h ddr4, i5-12400f, sapphire rx 6700 xt, Adata XPG gammix D20 32gb, Kingston KC3000 1tb

pingyaru avatar Oct 12 '23 19:10 pingyaru

Hi, there is indeed an issue with main.py and configure.py. They have been written to be launched from their own directory, because they search for resources in the current terminal folder.

Until it is fixed, you need first to move inside your Terminal to the folder where you have downloaded the program:

D:
cd "D:\small programs\turing-smart-screen-python-3.3.3\"

then you can run the main.py or configure.py from there:

C:\Users\Sergey\AppData\Local\Programs\Python\Python311\python.exe configure.py
C:\Users\Sergey\AppData\Local\Programs\Python\Python311\python.exe main.py

mathoudebine avatar Oct 17 '23 17:10 mathoudebine

Hi, there is indeed an issue with main.py and configure.py. They have been written to be launched from their own directory, because they search for resources in the current terminal folder.

Until it is fixed, you need first to move inside your Terminal to the folder where you have downloaded the program:

D:
cd "D:\small programs\turing-smart-screen-python-3.3.3\"

then you can run the main.py or configure.py from there:

C:\Users\Sergey\AppData\Local\Programs\Python\Python311\python.exe configure.py
C:\Users\Sergey\AppData\Local\Programs\Python\Python311\python.exe main.py

It worked! Thank you very much!

pingyaru avatar Oct 17 '23 18:10 pingyaru