Python and Java setup
Qwen Cloud provides DashScope SDKs (Python, Java) and supports OpenAI-compatible calls. OpenAI provides SDKs for Python, Node.js, Java, and Go.
Skip this section if you already have Python, Java, Node.js, or Go configured locally.

Run the code examples for the OpenAI SDK or the DashScope SDK.
Prepare the environment
Skip this section if you already have Python, Java, Node.js, or Go configured locally.
- Python
- Java
- Node.js
- Go
Check your Python version
Check if Python and pip are installed:
Python 3.8 or higher required. Install from python.org if needed.
python -V or pip --version returns "command not found"?
- Windows
- Linux and macOS
-
Install Python and add it to PATH. See Install Python.

- If the error persists after installing Python and setting PATH, restart your terminal and try again.
Configure a virtual environment (optional)
Create a virtual environment to isolate SDK dependencies (recommended).- Create a virtual environment
- Activate the virtual environment
- Windows:
- macOS/Linux:
Install the SDK
- Python
- Java
- Node.js
- Go
You can call Qwen Cloud APIs using the OpenAI Python SDK or the DashScope Python SDK.
Success message:
Success message:
Install the OpenAI Python SDK
Install the OpenAI Python SDK:
Successfully installed ... openai-x.x.xInstall the DashScope Python SDK
Install the DashScope Python SDK:
Successfully installed ... dashscope-x.x.xPip version warnings are safe to ignore.







