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

pgrep break windows #3

Open
sottom opened this issue Aug 26, 2019 · 4 comments
Open

pgrep break windows #3

sottom opened this issue Aug 26, 2019 · 4 comments

Comments

@sottom
Copy link

sottom commented Aug 26, 2019

The pgrep command used on the line at the link below breaks when run on Windows. The error is:
FileNotFoundError: [WinError 2] The system cannot find the file specified

Find a system agnostic way of doing it (using straight python perhaps).

return any_env or call(['pgrep', process]) == 0

@reubano
Copy link
Owner

reubano commented Aug 26, 2019

Idea: see if flask-caching does anything similar...

@sottom
Copy link
Author

sottom commented Sep 3, 2019

This library looks like it might be a good option: https://github.com/giampaolo/psutil.
https://thispointer.com/python-get-list-of-all-running-processes-and-sort-by-highest-memory-usage/

@reubano
Copy link
Owner

reubano commented Sep 3, 2019

@FarisHijazi
Copy link

same here

Traceback (most recent call last):
  File "...\processors.py", line 9, in <module>
    from mezmorize import Cache
  File "C:\Users\...\AppData\Roaming\Python\Python37\site-packages\mezmorize\__init__.py", line 24, in <module>
    from . import backends
  File "C:\Users\...\AppData\Roaming\Python\Python37\site-packages\mezmorize\backends.py", line 22, in <module>
    from .utils import (
  File "C:\Users\...\AppData\Roaming\Python\Python37\site-packages\mezmorize\utils.py", line 101, in <module>
    HAS_REDIS = redis and pgrep('redis')
  File "C:\Users\...\AppData\Roaming\Python\Python37\site-packages\mezmorize\utils.py", line 96, in pgrep
    return any_env or call(['pgrep', process]) == 0
  File "C:\tools\Anaconda3\envs\ptpip\lib\subprocess.py", line 339, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\tools\Anaconda3\envs\ptpip\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\tools\Anaconda3\envs\ptpip\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants