Registry / devops / appnope

appnope

JSON →
library1.0.0pypypi✓ verified 26d ago

Appnope is a small Python library for macOS (10.9 and later) that disables App Nap for the current process. It is primarily used in long-running Python applications and interactive environments like Jupyter notebooks to prevent them from being suspended when in the background. The current version is 0.1.4, and the library is in maintenance, receiving updates mainly for compatibility.

pip install appnope
INSTALL
IMPORT
SIG · APPNOPE
A
appnope
devopspythonv1.0.0
Install
1.7s avg
Import
12ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.008s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

appnope
import appnope
The primary way to use appnope; importing it automatically disables App Nap for the current process.
set_appnap_enabled
import appnope appnope.set_appnap_enabled(False)
Used to explicitly toggle App Nap status after initial import, or if you wish to re-enable it.

The simplest way to use appnope is to import it. This will automatically disable App Nap for the current Python process on supported macOS versions. For more granular control, `set_appnap_enabled()` can be used.

import appnope import time print("App Nap is now disabled for this process (macOS 10.9+).") print("Sleeping for 10 seconds. Check activity monitor if App Nap usually affects this process.") time.sleep(10) # To explicitly re-enable or disable App Nap later: # appnope.set_appnap_enabled(True) # Re-enable App Nap # appnope.set_appnap_enabled(False) # Disable App Nap again print("Done. App Nap status remains as last set.")
Debug
Known issues
gotchaAppnope is a macOS-specific library. It will not have any effect or may raise platform-specific errors if run on non-macOS operating systems.
fix
Ensure your environment is macOS (version 10.9 or later) when using appnope. It's advisable to guard its import with platform checks if your code needs to run on multiple OSes (e.g., `if sys.platform == 'darwin': import appnope`).
affects: All versions
gotchaApp Nap itself only exists on macOS 10.9 (Mavericks) and later. Using `appnope` on older macOS versions will have no effect related to App Nap, though the library might still import.
fix
Be aware of the target macOS version. The library's utility is limited to macOS 10.9+.
affects: All versions
gotchaAppnope disables App Nap only for the *current* process. If your Python application spawns child processes (e.g., using `subprocess` or `multiprocessing`), those child processes will not automatically inherit the App Nap disabled state and may still be subject to App Nap.
fix
If child processes also need App Nap disabled, you must import `appnope` within those child processes' entry points or apply equivalent OS-level settings.
affects: All versions
gotchaThe primary effect of `appnope` occurs immediately upon `import appnope`. It's not a function call that you explicitly make after import (unless you use `set_appnap_enabled`).
fix
Simply placing `import appnope` at the beginning of your script or interactive session is sufficient to disable App Nap for that process.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'appnope'
The 'appnope' module is not installed in the current Python environment.
fix
Install the module using pip: 'pip install appnope'.
ImportError: No module named 'appnope'
The 'appnope' module is not installed or not accessible in the current Python environment.
fix
Ensure the module is installed with 'pip install appnope' and that the correct Python environment is active.
AttributeError: module 'appnope' has no attribute 'nope'
The 'appnope' module is not correctly installed or is outdated.
fix
Reinstall the module using 'pip install --force-reinstall appnope'.
appnope not having any effect or raising platform-specific errors on non-macOS systems
'appnope' is a macOS-specific library designed to disable App Nap on macOS 10.9 (Mavericks) and later. It will have no functional effect or may raise errors if imported or used on other operating systems (like Windows or Linux) or older macOS versions.
fix
Guard the import and usage of `appnope` with a platform check: `import sys; if sys.platform == 'darwin': import appnope`. Ensure the target macOS version is 10.9 or newer.
Jupyter kernel died unexpectedly / Jupyter notebook kernel not connecting (related to appnope)
In certain environments, particularly with specific Python versions (e.g., Python 3.6) and macOS versions (e.g., macOS 11.5) in conjunction with Conda, 'appnope' can sometimes interfere with the Jupyter kernel's startup or stability, leading to the kernel dying or failing to connect.
fix
Disable 'appnope' within the IPython kernel configuration by adding `c.Kernel._darwin_app_nap = False` to your `~/.ipython/profile_default/ipython_kernel_config.py` file.
Upgrade
Version history
1.0.0latest on PyPI · released Aug 20, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
21
OpenAI (training)
1
Resources
appnope — pip install appnope · libregistry