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

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

Closed
pingyaru opened this issue Oct 12, 2023 · 2 comments · Fixed by #623
Closed

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

pingyaru opened this issue Oct 12, 2023 · 2 comments · Fixed by #623
Labels
enhancement New feature or request

Comments

@pingyaru
Copy link

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 pingyaru added the bug Something isn't working label Oct 12, 2023
@mathoudebine
Copy link
Owner

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

@pingyaru
Copy link
Author

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!

@mathoudebine mathoudebine changed the title Can't run configure.py Configure.py / main.py cannot be run from another folder Oct 20, 2023
@mathoudebine mathoudebine added enhancement New feature or request and removed bug Something isn't working labels Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants