OpenXLab is a Python library providing tools to interact with the OpenXLab platform, focusing on managing datasets and models. It includes a command-line interface (CLI) and a Python SDK to programmatically access platform features such as dataset information, upload, and download. The library is currently at version 0.1.3 and appears to have a regular release cadence, with updates often reflecting platform-level changes within the broader OpenXLab ecosystem.
pip install openxlabVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to authenticate with OpenXLab using environment variables for Access Key (AK) and Secret Key (SK), and then how to use the `openxlab.dataset.get` function to download a public dataset. Replace 'YOUR_AK_HERE' and 'YOUR_SK_HERE' with your actual credentials, or ideally, set them as environment variables (OPENXLAB_AK, OPENXLAB_SK). The example attempts to download the 'OpenDataLab/MNIST' dataset, which is a common public dataset.
While potentially resolved in newer versions, if you encounter `setuptools` conflicts, try isolating `openxlab` in a virtual environment or explicitly pinning `setuptools` to a compatible version as a temporary workaround. Check release notes for explicit dependency updates.
Always ensure your `OPENXLAB_AK` and `OPENXLAB_SK` environment variables are correctly set and valid, or that `openxlab config` has been run. Verify network connectivity to the OpenXLab API endpoints. For programmatic access, using environment variables is the most recommended and secure approach.
Refer to the official OpenXLab documentation (浦源-文档中心) for the most accurate and up-to-date SDK usage patterns and import paths. Confirm you are installing the correct `openxlab` package (`pip install openxlab`) if interacting with the OpenXLab platform.
Create a new virtual environment and install `openxlab` first, or downgrade/upgrade `setuptools` to a compatible version using `pip install setuptools==A.B.C` (replacing A.B.C with the version required by openxlab) before installing other conflicting packages.
Set up your authentication credentials by running the OpenXLab CLI configuration command: `python -m openxlab.cli config` and follow the prompts to enter your AK and SK. Alternatively, you can create a `config.json` file in `~/.openxlab/` or set `OPENXLAB_AK` and `OPENXLAB_SK` environment variables.
Re-authenticate using `openxlab login --relogin` in the CLI or re-run `python -m openxlab.cli config` to ensure your credentials are up-to-date and correctly configured. Verify that your Access Key and Secret Access Key are correct and have the necessary permissions.
Ensure `openxlab` is correctly installed via `pip install openxlab`. If the issue persists, explicitly run the CLI using `python -m openxlab.cli` or verify that the directory where pip installs scripts (e.g., `~/.local/bin` on Linux or Python's `Scripts` directory on Windows) is included in your system's PATH. You may need to restart your terminal after installation.
Check your internet connection and ensure the dataset repository name is correct (e.g., `username/repo_name`). You can also try again later as it might be a temporary server issue. If the problem persists, check the OpenXLab platform for the dataset's availability and permissions.