psutil is never installed on Windows
See original GitHub issueOn Windows, it turns out pyperf (and hence pyperformance) will always print a warning when psutil is not installed. The warning is:
WARNING: unable to increase process priority
It is printed by _process_priority()
. (Note the if not MS_WINDOWS: return
right before.)
The function set_priority()
silently returns None
, but the caller prints the warning in that case.
So now for every benchmark run by pyperformance it calls this _process_priority()
function for each run, printing the warning each time (maybe 10 times per run).
The solution of course is to install psutil. But no matter what I do, because the way venvs used to run the benchmark are created, those venvs do not get psutil installed, even if it is installed in site-packages. (At least, when running from a dev environment.)
- I tried adding
"psutil"
to theinstall_requires
line in pyperformance’s setup.py, but that doesn’t seem to help. - psutil is already listed in requirements.in, so that doesn’t seem to make a difference.
- It is also listed in pyperformance/data-files/requirements.txt, apparently with no effect.
So how do I add this dependency to every package? Surely there’s a more elegant way than adding it to every benchmark-specific requirements.txt file in pyperformance/data-files/benchmarks?
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (16 by maintainers)
Top GitHub Comments
Still no dice. 😦
Now it does indeed try to install psutil, but since there’s no wheel, it tries to build from source, and fails in the same way I’ve described elsewhere. And since apparently in this case there’s no way to get a psutil wheel to end up in pip’s wheel cache I still cannot get this working.
UPDATE: There is a way to get a psutil wheel in the pip cache (same as before), and then it does work. Not sure what I did wrong the first time I tried.
It would be nice to put that command in
pyperformance compile
, since it’s non-trivial and it’s always pleasant when things are automated. Running a benchmark is hard enough 😉