Install & Compatibility
Where this runs
tested against v2.5.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
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.652s · 21.5MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.1s · import 0.590s · 22MB
20MB installed
● package 20MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Redmine
✓ from redminelib import Redmine
✗ from python_redmine import Redmine
The top-level package for import is `redminelib`, not `python_redmine`.
RedmineError
✓ from redminelib.exceptions import RedmineError
Exceptions are in a dedicated submodule.
This quickstart connects to a Redmine instance using an API key, fetches information about the current user, lists the first five projects, and attempts to retrieve a specific issue by ID. Ensure you have your Redmine URL and API key configured.
import os
from redminelib import Redmine
from redminelib.exceptions import ResourceNotFoundError
# Replace with your Redmine URL and API Key
REDMINE_URL = os.environ.get('REDMINE_URL', 'http://localhost:3000')
REDMINE_API_KEY = os.environ.get('REDMINE_API_KEY', 'YOUR_API_KEY_HERE')
try:
redmine = Redmine(REDMINE_URL, key=REDMINE_API_KEY)
# Get current user
me = redmine.user.get('current')
print(f"Connected to Redmine as: {me.firstname} {me.lastname} ({me.login})")
# Get a list of projects
projects = redmine.project.all(limit=5)
print("\nFirst 5 Projects:")
for project in projects:
print(f" - {project.name} (ID: {project.id})")
# Try to get a specific issue
try:
issue = redmine.issue.get(1)
print(f"\nIssue #1: {issue.subject} (Status: {issue.status.name})")
except ResourceNotFoundError:
print("\nIssue #1 not found.")
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
breakingPython 2.x, 3.3, 3.5, and 3.6 support has been dropped. Python-Redmine now requires Python >= 3.7.fixUpgrade your Python environment to 3.7 or newer. For older Python versions, use python-redmine < 2.2.0 or < 2.4.0 depending on your exact version.
affects: >=2.4.0 (for 3.5, 3.6), >=2.2.0 (for 2.x, 3.3)
breakingThe `requests` package, previously vendored, became an external dependency. If you were relying on it being bundled, your code might fail.fixEnsure `requests` is installed explicitly via `pip install requests` alongside `python-redmine`. This is now handled automatically by `pip install python-redmine`.
affects: >=2.2.0
gotchaMinimum `requests` version requirements are periodically updated (e.g., to >= 2.31.0 in v2.5.0, >= 2.28.2 in v2.4.0). Using an older `requests` version might lead to dependency conflicts or unexpected behavior.fixAlways install the latest `python-redmine` which will pull in a compatible `requests` version, or explicitly update `requests` to meet the library's minimum requirements (e.g., `pip install requests --upgrade`).
affects: >=2.4.0
gotchaSome features, like the `/my/account` endpoint for non-admin users (`redmine.user.get('me')`), News API, or RedmineUP plugin support, require a minimum Redmine API version.fixCheck the Python-Redmine documentation for specific feature requirements. Ensure your Redmine server version meets the minimum required version for the functionality you are trying to use (e.g., Redmine >= 4.1.0 for some `/my/account` and News features).
affects: All versions
Errors
Common errors & fixes
from python_redmine import Redmine
ModuleNotFoundError: No module named 'python_redmine'
Incorrect import path. The main package for importing classes is `redminelib`, not `python_redmine`.
fixChange your import statement to `from redminelib import Redmine`.
redminelib.exceptions.ResourceNotFoundError: The resource you are trying to access doesn't exist.
Attempted to access a Redmine resource (e.g., issue, project, user) with an ID that does not exist or is inaccessible.
fixVerify the ID you are using is correct and that the user associated with the API key has permissions to view that resource. Check Redmine directly to confirm the resource's existence and visibility.
redminelib.exceptions.RedmineError: No 'X-Redmine-API-Key' header found.
The Redmine API key was not provided or is incorrect, or the Redmine server is not configured to accept API key authentication.
fixEnsure you are passing a valid API key to the `Redmine` constructor (e.g., `key='YOUR_API_KEY'`). Verify that API authentication is enabled in your Redmine server settings (Administration -> Settings -> Authentication -> 'Enable REST API').
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
The Redmine URL is incorrect, the server is offline, or there is a network issue preventing connection to the Redmine instance.
fixDouble-check the `REDMINE_URL` you are using. Ensure the Redmine server is running and accessible from where you are running your Python code. Verify any firewalls or proxies are not blocking the connection.
Upgrade
Version history
2.5.0latest on PyPI · released Mar 31, 2024
Audit
Dependencies
requestsrequiredUsed for HTTP communication with the Redmine API. It became an external dependency in v2.2.0.