-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Packaged wheels/exes are not compatible with Win XP #811
Comments
This is likely due to the old pip version you're using. |
Also, closing this as a duplicate of #810. |
@giampaolo This is actually due to the fact that the psutil whls deployed to pypi are built on Windows Vista or newer (or it seems that way). The Currently, the only way to get psutil to work on Windows XP is to install from source. This can be done with However... that requires you to run on Windows XP. If you want to compile on Windows Vista or newer, and be able to run your python application on Windows XP you can't unless you manually modify the setup.py script before installing on your Vista or newer box. I recommend not having the setup.py file compile based on the host OS, but instead on an extra parameter, like -robodude666 |
I think @robodude666 is right. With |
Update After trying different history version from pypi, |
Yup. Windows XP support from whl was broken with 3.4.2 was the last version that used |
Seeing this as well. I believe @robodude666 is correct. The logic in ab9f29b checks |
Sorry for delaying on this one, I've been busy. As a recap:
|
So, as for how to fix this issue: my first idea was to not rely on the C pre-processor ( |
...and in fact here it is (Python source code comes to the rescue :P): |
I submitted a patch in e481df9. |
I tried the build it still fails with the same DLL error. Glancing over the code again, off the top of my head I would guess any use of psutil/psutil/_psutil_windows.c Line 21 in e481df9
|
Mmm, you're right. In this case I'm not sure how to apply the same strategy against the .h file. I suppose C won't allow that. That leaves us with one option only: providing exes/wheels specific for Win XP, but I'm not willing to do that: it's too much effort. |
I'm not willing to fix this issue for new versions by distributing XP only exes/wheels but I want to provide a more meaningful error message. Something along the lines of "Windows XP is no longer supported; latest version supporting it is 3.4.2" |
FWIW I don't think there's a problem with the #include that is wrapped with the ifdef ( psutil/psutil/_psutil_windows.c Line 21 in e481df9
psutil/psutil/_psutil_windows.c Line 2227 in e481df9
However, even if the DLL will load correctly after fixing these calls, there could still be invalid memory access (=crashes) on older systems due to incorrect struct sizes in other places where we use extended classes (e.g. psutil/psutil/_psutil_windows.c Line 741 in e481df9
In any case, the #include is only for compile time so it will not be a problem as long as we avoid using its definitions on XP. Just my two cents. |
Right now the doc states that latest wheel / exe version compatible with Win XP is psutil 3.4.2. |
I understand, I'm just pointing out that theoretically it is possible to support WinXP in the same distribution - the header issue (pointed out in #811 (comment)) is not a problem. |
Hi @giampaolo, that same error also happens on Windows Server 2003 R2 x64. However we are using Python 2.7 with psutil 4.4.2. In this case, the exception is:
We've tried to updage psutil to version 5.2.2. The exception changed:
The only way to use psutil on Windows 2003 Server is with version 3.4.2? Is there a workaround using latest versions? Thanks |
@raphael-santos See my response above. You can manually install |
( Using Windows XP )
Recently updated Spyder with
This upgraded dependencies too, including psutil, got psutil-5.4.3-cp27-none-win32.whl Spyder crashed silently during load ( no traceback, pythonw ) ... no clue And today found this page, updated to 5.4.3 source, worked. I don't have knowledge about pip and Pypi internals, but wonder if there are no means to avoid this behaviour through some package metadata, so that pip is aware it's running in XP and falls back to download binary 3.4.2 or source 5.4.3 ? |
Windows XP is no longer supported. Latest version supporting it should be 3.4.2. You may try compileing 5.3.3 from sources and it may work (but not sure): |
* master: (375 commits) update psutil fix procsmem script which was not printing processes try to fix tests on travis try to fix tests on travis OSX: fix compilation warning giampaolo#936: give credits to Max Bélanger giampaolo#811: move DLL check logic in _pswindows.py winmake: use the right win slashes winmake: do not try to install GIT commit hook if this is not a GIT cloned dir giampaolo#811: on Win XP let the possibility to install psutil from sources as it still (kind of) works) giampaolo#811: add a Q&A section in the doc; tell what Win versions are supported giampaolo#811: raise a meaningful error message if on Windows XP update doc; bump up version giampaolo#939: update MANIFEST to include only src files and not much else update HISTORY travis: execute mem leaks and flake8 tests only on py 2.7 and 3.5; no need to test all python versions bump up version update version in doc add simple test case for oneshot() ctx manager add simple test case for oneshot() ctx manager speedup fetch all process test by using oneshot giampaolo#799 - oneshot / linux: speedup memory_full_info and memory_maps fix flake8 first pass giampaolo#943: better error message in case of version conflict on import. update doc 799 onshot / win: no longer store the handle in python; I am now sure this is slower than using OpenProcess/CloseHandle in C update doc (win) add memleak test for proc_info() move stuff around memleak: fix false positive on windows giampaolo#933 (win) fix memory leak in WindowsService.description() giampaolo#933 (win) fix memory leak in cpu_stats() (missing free()) refactoring giampaolo#799 / win: pass handle also to memory_maps() and username() functions fix numbers mem leak script: provide better error output in case of failure refactor memleak script refactor memleak script refactor memleak script refactor memleak script refactor memleak script: get rid of no longer used logic to deal with Process properties memleak script refactoring doc styling giampaolo#799 / win: use oneshot() around num_threads() and num_ctx_switches(); speedup from 1.2x to 1.8x refactor windows tests win: enable dueal process impl tests win / C: refactor memory_info_2 code() and return it along side other proc_info() metrics windows c refactor proc_info() code update windmake script winmake clean: make it an order of magnitude faster; also update Makefile update doc bench script: add psutil ver winmake: more aggressive logic to uninstall psutil adjust bench2 script to new perf API try to adjust perf upgrade perf code memory leak script: humanize memory difference in case of failure style changes fix giampaolo#932 / netbsd: check connections return value and raise exception netbsd / connections: refactoring netbsd / connections: refactoring netbsd / connections: refactoring netbsd / connections: refactoring netbsd / connections: refactoring testing make clean with unittests was a bad idea after all make 'make clean' 4x faster! add test for make clean adjust winmake script fix netbsd/openvsd compilation failure bsd: fix mem leak osx: fix memory leak pre-release refactoring update IDEAS add mtu test for osx and bsd osx: separate IFFLAGS function osx/bsd: separate IFFLAGS function linux: separate IFFLAGS function share C function to retrieve MTU across all UNIXes HISTORY: make anchors more easily referenceable fix giampaolo#927: Popen.__del__ may cause maximum recursion depth error. fix Popen test which is occasionally failing more releases timeline from README to doc ignore failing tests on OSX + TRAVIS update INSTALL instructions update print_announce.py script update HISTORY HISTORY: provide links to issues on the bug tracker update IDEAS giampaolo#910: [OSX / BSD] in case of error, psutil.pids() raised RuntimeError instead of the original OSError exception. fix unicode tests on windows / py3 small test refactoring fix giampaolo#926: [OSX] Process.environ() on Python 3 can crash interpreter if process environ has an invalid unicode string. osx: fix compiler warnings refactor unicode tests fix unicode test giampaolo#783: fix some unicode related test failures on osx test refactoring test refactroring ...
* 'pslisten' of github.com:nlevitt/psutil: (922 commits) Update INSTALL.rst Pass python_requires argument to setuptools (giampaolo#1208) giampaolo#1152: fix doc to mention CLI command necessary to enable disk_io_counters() on win pre release pre release pre release pre-release fix giampaolo#1201: document that timeout kwarg is expressed in seconds Add mount points to disk_partitions() in Windows (giampaolo#775) (giampaolo#1192) add test for cpu_affinity what a stupid bug! (giampaolo#1190) update doc pre release pre-release; also get rid of PSUTIL_DEBUG doc instructions (it's kinda useless for the user after all) Use FutureWarning instead of DeprecationWarning (giampaolo#1188) fix test refactor environ() test Fix OSX pid 0 bug (giampaolo#1187) change assert in test refactor Process.__repr__ Faster Process.children(recursive=True) (giampaolo#1186) Speedup Process.children() (giampaolo#1185) update doc update HISTORY fix giampaolo#1179 / linux / cmdline: handle processes erroneously overwriting /proc/pid/cmdline by using spaces instead of null bytes as args separator set x bit to test_aix.py fix giampaolo#1181: raise AD if task_for_pid() fails with 5 and errno == ENOENT fix posix failure Arguments for NoSuchProcess and AccessDenied for the C ext (giampaolo#1180) fix travis failure https://travis-ci.org/giampaolo/psutil/jobs/306424509 be smarter in searching python exe do not test platf specific modules on wheelhouse try to fix travis failure fix travis failures try to use PYTHON_EXE instead of sys.executable giampaolo#1177: give credits to @wiggin15 OSX: implement sensors_battery (giampaolo#1177) improve error msg for old windows systems giampaolo#811 add debug messages do not mention apt-get as method of installation as it's not recommended syntax highlight in doc files syntax highlight in doc files fix doc indentation 1173 debug mode (giampaolo#1176) code style update MANIFEST giampaolo#1174: use TimeoutExpired in wait_pid() sort imports by name Move exceptions to separate file (giampaolo#1174) appveyor: enable python warnings when running tests refactor winmake.py use a C global variable to figure out whether we're in testing mode fix unicode err define a setup() function which is called on import by all C modules move PyUnicode compt fun definition up in the file rename C func re-enable test on appveyor; remove unused C code refactor PSUTIL_TESTING C APIs inspect PSUTIL_TESTING env var from C again giampaolo#1152: (DeviceIOControl), skip disk on ERROR_INVALID_FUNCTION and ERROR_NOT_SUPPORTED giampaolo#1152 / win / disk_io_counters(): DeviceIOControl errors were ignored; che return value and retry call on ERROR_INSUFFICIENT_BUFFER upgrade dist cmds change make cmds disable IPv6 tests if IPv6 is not supported travis / OSX: run py 3.6 instead of 3.4 fix giampaolo#1169: (Linux) users() hostname returns username instead update README, bump up version get rid of PSUTIL_TESTING env var: it must be necessarily set from cmdline, hence 'python -m psutil.tests' won't work out of the box try to set PSUTIL_TESTING env var from python before failing skip cpu_freq tests if not available (giampaolo#1170) update doc pre-release giampaolo#1053: drop python 3.3 support try to fix appveyor failure; also refactor generate_manifest.py giampaolo#1167 give CREDITS to @matray Including non-unicast packets in packet count calculation (giampaolo#1167) fix giampaolo#1166 (doc mistake) provide a 'make help' command ifconfig.py humanize bytes try to limit false positives on appveyor/windows reap_children() in a finally block in order to limit false positives unicode tests: use different name for test dir fix failure on osx/travis update Makefile fix test giampaolo#1164 give CREDITS to @wiggin15 AIX: implement num_ctx_switches (giampaolo#1164) use new PYTHON_EXE improve logic to determine python exe location add DEVNOTES file; move TODO.aix into _psutil_aix.c Fix test_emulate_energy_full_not_avail (giampaolo#1163) update README try to limit occasional appveyor failure Remove trove classifiers for untested and unsupported platforms (giampaolo#1162) Fix giampaolo#1154: remove 'threads' method on older AIX (giampaolo#1156) give CREDITS to @adpag for giampaolo#1159, giampaolo#1160 and giampaolo#1161 Fix test asserts due to leftover test subprocesses (giampaolo#1161) Fix network tests for newer ifconfig versions. (giampaolo#1160) Fix pre-commit hook for python 3.x. (giampaolo#1159) revert last commit ...
can not load psutil 4.1.0 on Windows XP, SP3, Python 3.4.3 :
Microsoft Windows XP [Version 5.1.2600]
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
import psutil
Traceback (most recent call last):
File "", line 1, in
File "C:\Python34\lib\site-packages\psutil__init__.py", line 124, in
from . import _pswindows as _psplatform
File "C:\Python34\lib\site-packages\psutil_pswindows.py", line 14, in
from . import _psutil_windows as cext
ImportError: DLL load failed: The specified procedure could not be found.
And I can not update that particular machine, because it is a gateway for an ancient database.
Please Help !
The text was updated successfully, but these errors were encountered: