-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
psutil is never installed on Windows #148
Comments
@vstinner cc @gvanrossum @ericsnowcurrently |
No, I think this has to do with how pyperformance manages venvs. @ericsnowcurrently |
pyperformance does install psutil in VirtualEnvironment._install_req():
But if the installation fails, it only logs a warning. psutil is marked as an "optional" dependency because I failed issues sometimes to install it on psutil or on development versions of Python:
It's listed in pyperformance/requirements.in:
|
Currently, psutil is hardcoded as an "optional dependency" in venv.py: it tries to install it, but if pip fails, it only logs a warning. Do you see this warning when you just create a venv using the |
Victor, it looks like you're looking at an earlier version of pyperformance. I suspect that @ericsnowcurrently accidentally broke this (perhaps only for Windows). |
No, I don't see that warning, and psutil is not present in the created venv. |
#170 should fix it. I suspect that I originally thought psutil was in pyperf's requirements.txt (it isn't), but didn't check. |
(see #148) pyperf treated psutil as an optional dependency. Most of the time it should be installable, but we weren't really even trying. This change fixes that.
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. |
Ah, so now the remaining issue is "psutil wheels are not available for 3.11". |
I would rather summarize it as "on Windows, building extensions from source doesn't work in a venv created using a python.exe built in the cpython source repo". Having psutil wheels for 3.11 available is only one of the many ways to mask this problem. :-) |
got it would it help if psutil released a stable ABI wheel for the extension? |
Just in case, I created giampaolo/psutil#2089. |
See #171, it's a more general issue. |
On Linux, the https://pyperformance.readthedocs.io/usage.html#compile-python-to-run-benchmarks Maybe you should try to do something similar on Windows? |
Yes, @zooba showed me how to do this:
|
It would be nice to put that command in |
On Windows, it turns out pyperf (and hence pyperformance) will always print a warning when psutil is not installed. The warning is:
It is printed by
_process_priority()
. (Note theif not MS_WINDOWS: return
right before.)The function
set_priority()
silently returnsNone
, 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.)
"psutil"
to theinstall_requires
line in pyperformance's setup.py, but that doesn't seem to help.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?
The text was updated successfully, but these errors were encountered: