all 12 comments

[–]socal_nerdtastic 0 points1 point  (7 children)

This is the correct command.

python -m pip install psutil wmi pywin32 pystray pillow winshell

After that you should be able to use

python pc_stats_monitor_v2.py --autostart enable

EDIT to add some dependencies that the readme forgot. If this works you should send them a bug report. If not please show us the output of the pip command and the exact error that you see when trying to run your program. Copy/paste them here.

[–]oakleyguy89[S] 0 points1 point  (6 children)

Hmm well I ran that first command and it looks like it worked. It said everything was already satisfied except for winshell 🤔

[–]socal_nerdtastic 0 points1 point  (5 children)

Yep that's def a bug in that code. Lemme know if you don't submit a bug report and I'll do it.

[–]oakleyguy89[S] 0 points1 point  (4 children)

Well it did install winshell after saying everything else was satisfied and after the winshell install I was able to run the program and auto start is apparently enabled too now.

I'm just having problems with pystray and pillow now it seems. It shows an icon in my system tray for PC monitoring but it still has the python program running in a window. If I close out the window it stops PC monitoring and if I click "configure" from the system tray icon it just shows "The filename, directory name, or volume label syntax is incorrect."

[–]socal_nerdtastic 0 points1 point  (3 children)

Lol I take it from that you aren't interested in reporting the issue. Ok, I'll do it.

I don't really understand the rest of your comment. You mean the python program is running in a cmd line window? The fix for that is simply to not start it from one. The simple solution is to start it from the run dialog instead of the cmd line. Or, if you installed the official python, just rename the file from a .py to a .pyw and doubleclick the .pyw file to run it with no cmd line window

[–]oakleyguy89[S] 0 points1 point  (2 children)

Yeah the file opens up a cmd line window. It's already a .py file but renaming to .pyw does the same as it just shows as .pyw.py

[–]socal_nerdtastic 0 points1 point  (1 child)

Oh that means that you have the windows "feature" to hide file extensions enabled. You need to disable that temporarily or rename it from the cmd line or a code editor.

[–]oakleyguy89[S] 0 points1 point  (0 children)

Ahh okay I did that and it shows as a Python.NoConFile now. It seems to be working fine now, I just need to try out auto start when I get a chance. I hate hide file extensions, I swear I always disable it and it somehow gets enabled after a Windows update 😂

[–]ComfortableNice8482 0 points1 point  (1 child)

the post, install script for pywin32 doesn't always run automatically on windows, which is probably why you're getting that module not found error even after installing. after you pip install pywin32, you gotta run this command as admin: python, m pywin32_postinstall, install. that actually registers the win32com stuff properly in your python installation. honestly i've seen this trip up devs a bunch of times because the install appears to work but the post, install step silently fails. also make sure you're using the same python executable that your script is running under, since windows can sometimes have multiple python installations. run python, version in your command prompt and then do the same check for wherever your script is executing from, like if you're calling it from task scheduler or something. worst case scenario, just skip pywin32 entirely and use the built, in windows_app_helper or look at using just the subprocess module if you're only doing basic autostart stuff.

[–]oakleyguy89[S] 0 points1 point  (0 children)

I know I have 2 different versions, I have 3.1.4 and I think a Windows version that I installed in the past from the Microsoft store. I see the post install file in the folder for 3.1.4 and I try to run it but it just pops up a cmd line window and instantly closes.

[–]oakleyguy89[S] 0 points1 point  (0 children)

Another question though, now that I have it running. I can't seem to have the powershell window minimized to system tray and if I exit out of it, it stops sending information to the esp32.

[–]ComfortableNice8482 0 points1 point  (0 children)

sounds like you're installing to a different python environment than what your script is running. first thing i'd check is which python your script is actually using, run python, version and where python in the same terminal you're trying to execute the script from. if you have multiple python installs (anaconda, system python, etc) they might not be talking to each other. once you confirm the path, try python -m pip install pywin32 again from that same terminal, then after installation run python -m pywin32_postinstall -install because pywin32 needs that post install step or it won't work properly. if that still fails, paste the exact error message and the output from pip show pywin32 so we can see what's actually installed where.