Rucio Clients
raw JSON → 40.1.0 verified Mon Apr 27 auth: no python
Rucio Client Package: Python client library for Rucio, a distributed data management framework used primarily by high-energy physics experiments (e.g., ATLAS, CMS, SKA). Version 40.1.0, monthly release cadence. Supports Python >=3.9.
pip install rucio-clients Common errors
error ModuleNotFoundError: No module named 'rucio' ↓
cause rucio package (server-side) is not installed; rucio-clients depends on it for library code.
fix
pip install rucio rucio-clients (or just rucio-clients, which pulls rucio as dependency).
error ImportError: cannot import name 'DownloadClient' from 'rucio.client' ↓
cause DownloadClient is in submodule rucio.client.downloadclient, not directly in rucio.client.
fix
Use: from rucio.client.downloadclient import DownloadClient
error FileNotFoundError: [Errno 2] No such file or directory: '""' ↓
cause Missing or empty RUCIO_ACCOUNT or RUCIO_AUTH_TYPE environment variables.
fix
Set required environment variables before instantiating Client(): export RUCIO_ACCOUNT=<username>; export RUCIO_AUTH_TYPE=userpass; export RUCIO_CREDS=<password>
error RucioException: Authentication error ↓
cause Invalid credentials or mismatched auth type.
fix
Check RUCIO_ACCOUNT, RUCIO_AUTH_TYPE, and RUCIO_CREDS (or x509 certificate proxy). For x509, ensure RUCIO_CLIENT_CERT points to valid PEM file.
Warnings
breaking Python 3.9 minimum: rucio-clients 40+ drops support for Python 3.8 and earlier. ↓
fix Upgrade to Python 3.9+ before installing rucio-clients >=40.
gotcha Client authentication requires environment variables (RUCIO_ACCOUNT, RUCIO_AUTH_TYPE, RUCIO_CREDS) or config file; missing them causes silent default fallback to anonymous, often leading to permission errors. ↓
fix Set RUCIO_ACCOUNT and RUCIO_AUTH_TYPE (e.g., 'userpass', 'x509', 'x509_proxy') before creating Client(). Also set RUCIO_CREDS for password or RUCIO_CLIENT_CERT for x509.
deprecated The rucio.client.client.Client class init parameter 'auth_type' is deprecated in favor of environment variable RUCIO_AUTH_TYPE. ↓
fix Set RUCIO_AUTH_TYPE environment variable instead of passing auth_type argument.
Imports
- Client wrong
from rucio import Clientcorrectfrom rucio.client import Client - DownloadClient wrong
from rucio.downloadclient import DownloadClientcorrectfrom rucio.client.downloadclient import DownloadClient - UploadClient wrong
from rucio.uploadclient import UploadClientcorrectfrom rucio.client.uploadclient import UploadClient - DidClient wrong
from rucio.client import DIDClientcorrectfrom rucio.client.didclient import DIDClient
Quickstart
from rucio.client import Client
from rucio.client.downloadclient import DownloadClient
# Assumes RUCIO_ACCOUNT, RUCIO_AUTH_TYPE env vars set (e.g., userpass, x509)
client = Client()
# Download a dataset
downloader = DownloadClient(client)
dids = [{'scope': 'mock', 'name': 'test.file', 'type': 'FILE', 'base': '/tmp/'}]
downloader.download_dids(dids)