Troubleshootingο
A directory of the failures users hit most often, and how to fix each one.
Permission errorsο
PermissionError when opening another processο
The most common first hurdle β the OS is denying access.
| Platform | Fix |
|---|---|
| πͺ Windows | Run your terminal as Administrator. Anti-cheat-guarded processes may still refuse β that's expected and intentional. |
| π§ Linux | Run as root, or relax ptrace_scope:sudo sysctl kernel.yama.ptrace_scope=0Opening your own process always works. |
| π macOS | The Python binary must be signed with the com.apple.security.cs.debugger entitlement (or SIP off + root). Opening the current process always works β great for trying things out. |
See Platform Notes for the full story.
PermissionError from a specific operation (Windows)ο
You opened the process with a narrower permission mask than the operation
needs. The most common culprit is allocating memory without
PROCESS_VM_OPERATION:
from PyMemoryEditor import OpenProcess, ProcessOperationsEnum
# Need PROCESS_VM_OPERATION for allocate_memory.
with OpenProcess(
process_name="game.exe",
permission=ProcessOperationsEnum.PROCESS_VM_READ
| ProcessOperationsEnum.PROCESS_VM_WRITE
| ProcessOperationsEnum.PROCESS_VM_OPERATION
| ProcessOperationsEnum.PROCESS_QUERY_INFORMATION,
) as process:
address = process.allocate_memory(64)
Process lookup errorsο
ProcessNotFoundErrorο
No running process matches the given name. Names are case-sensitive by default on Linux/macOS and case-insensitive on Windows. Try:
OpenProcess(process_name="chrome", exact_match=False, case_sensitive=False)
Or pass pid= directly if you can find it via ps, Task Manager or
Activity Monitor.
AmbiguousProcessNameErrorο
More than one process matches a partial name. Pick a PID from .pids and
pass it explicitly:
from PyMemoryEditor import OpenProcess, AmbiguousProcessNameError
try:
process = OpenProcess(process_name="chrome", exact_match=False)
except AmbiguousProcessNameError as exc:
print("Multiple matches:", exc.pids)
process = OpenProcess(pid=exc.pids[0])
ProcessIDNotExistsErrorο
The given pid= doesnβt correspond to any running process. The PID may have
been recycled between when you obtained it and when you opened it β this
happens with short-lived processes.
Read / write failuresο
A scan returns nothing on Windowsο
Region enumeration needs PROCESS_QUERY_INFORMATION, which the default
permission already includes. If you passed a custom permission= mask,
make sure that flag is in it.
mask = ProcessOperationsEnum.PROCESS_VM_READ | ProcessOperationsEnum.PROCESS_QUERY_INFORMATION
Reading an address gives garbage or raises OSErrorο
Two common causes:
The page was freed between scan and read (normal during live scans against active processes). Wrap one-off reads in
try/except OSError.The value type or size is wrong. A 4-byte int read of an 8-byte value decodes the wrong half. Double-check the
pytypeandbufflength.
try:
value = process.read_process_memory(address, int, 4)
except OSError:
value = None
ValueError: bufflength is requiredο
str and bytes reads need an explicit size β only numeric types have
defaults:
# Wrong
process.read_process_memory(address, str)
# Right
process.read_process_memory(address, str, 32)
ResourceWarning on macOS writesο
The library elevated a read-only pageβs protection to write to it, then failed to restore the original protection (usually because the target task disappeared mid-call). The page is left more permissive than it started.
Treat the warning as a signal to investigate β see Platform Notes β macOS.
Pointer issuesο
resolve_pointer_chain returns garbageο
The target is a 32-bit process and you didnβt pass
ptr_size=4.One of the offsets is wrong (off-by-one in the chain).
The chain is dynamic and has already moved β use a
RemotePointerto re-walk it on every access.
path.rebase() raises ValueErrorο
The path has no associated module β its base came from a caller-supplied
static_ranges. Such paths only work in the run they were found in;
re-discover the chain in the new run.
path.rebase() raises LookupErrorο
The module is no longer loaded in the target process. Either the module was unloaded, or youβre looking at a different process than the one you scanned.
Loggingο
Need more detail? PyMemoryEditor logs to a standard logging logger named
"PyMemoryEditor" (silent by default). Turn it on to see exactly which
pages the library skips during a scan and why:
import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger("PyMemoryEditor").setLevel(logging.DEBUG)
The bundled app exposes the same stream in its Log Console (Tools β Log Console).
See Logging for advanced routing.
Reporting a bugο
Still stuck? Open an issue at github.com/JeanExtreme002/PyMemoryEditor/issues.
Please include:
The OS (with version) and Python version.
The exact code that triggered the failure.
The full traceback.
Any
PyMemoryEditorlog output (run withlevel=logging.DEBUG).