Naver Cloud Platform Python SDK
raw JSON → 2.8.1 (ncloud meta-package) verified Tue May 12 auth: no python install: verified quickstart: stale
Official Python SDK for Naver Cloud Platform (NCP) — South Korea's primary cloud provider, equivalent to AWS in the Korean market. Provides programmatic access to NCP infrastructure services: servers, VPC, CDN, DNS, Object Storage, and more. The SDK is split into service-specific packages (ncloud-server, ncloud-vserver, ncloud-vpc, ncloud-cdn, etc.) — install only the services you need. IMPORTANT: NCP has two distinct environments — Classic and VPC — with separate SDK modules, different API endpoints, and incompatible APIs. ncloud-server targets Classic, ncloud-vserver targets VPC. New accounts should use VPC.
pip install ncloud Common errors
error ModuleNotFoundError: No module named 'ncloud_server' ↓
cause This error occurs when the `ncloud-server` package, or another service-specific package, has not been installed, or the Python environment where it was installed is not active. The `ncloud-sdk-python` is a meta-package; individual service packages like `ncloud-server` or `ncloud-vserver` must be installed separately.
fix
Install the specific service package you intend to use. For example, for Classic Server services:
pip install ncloud-server
For VPC Server services:
pip install ncloud-vserver error ApiException: (401) Reason: Unauthorized ↓
cause This API error indicates that your request lacks valid authentication credentials (Access Key ID and Secret Key) or that the provided credentials are incorrect, expired, or do not have the necessary permissions to access the requested resource. It can also occur if the credentials are not properly configured or if there are IP access restrictions set on the Naver Cloud Platform console.
fix
Ensure your
access_key and secret_key are correctly set in your SDK configuration. Verify that these keys are active and have the required permissions in the Naver Cloud Platform console (My Account > Manage account and security > Manage access). Also, check for any IP access restrictions that might be blocking your connection. error ApiException: (400) Reason: Bad Request, message: Invalid request parameter ↓
cause This error often arises when there's a mismatch between the API you are calling (e.g., a Classic environment API) and the server type or parameters you are providing (e.g., using VPC-specific parameters with a Classic API or vice-versa), or if a required parameter is missing or malformed. Naver Cloud Platform has distinct Classic and VPC environments with incompatible APIs.
fix
Review the Naver Cloud Platform API documentation for the specific service and operation you are trying to perform. Confirm whether you are targeting the Classic or VPC environment and ensure that your request parameters, API endpoint, and the SDK module (e.g.,
ncloud-server for Classic vs. ncloud-vserver for VPC) align with that environment's specifications. Check for any typos in parameter names or incorrect data types/formats for parameter values. error AttributeError: module 'ncloud_server' has no attribute 'V2Api' ↓
cause This error occurs when you try to access a class or attribute that does not exist within the imported module, or if there's a version incompatibility. In the case of `ncloud-sdk-python`, it usually means you're trying to use a method or class (like `V2Api`) from a module that doesn't expose it, or the import path is incorrect.
fix
Verify the exact class name and its availability within the imported module by checking the official SDK documentation or the
__init__.py files of the service package. Ensure you are importing the correct service client and API class for your intended operation. For instance, the common pattern is to import from the service package directly and instantiate the V2Api:
import ncloud_server
api_instance = ncloud_server.V2Api(...)
Or from ncloud_vserver for VPC. Warnings
breaking Classic and VPC environments are completely separate API surfaces with different modules, endpoints, and product codes. ncloud-server (Classic) and ncloud-vserver (VPC) are NOT interchangeable. Classic uses 'https://ncloud.apigw.ntruss.com/server/v2', VPC uses 'https://ncloud.apigw.ntruss.com/vserver/v2'. Calling Classic APIs on a VPC account or vice versa returns auth or resource-not-found errors. ↓
fix New accounts: always use ncloud-vserver (VPC). Check your account type in the NCP console. If you created your account after 2020, it is almost certainly VPC.
gotcha Server image product codes and server product codes are not human-readable strings — they are opaque codes like 'SW.VSVR.OS.LNX64.CNTOS.0703.B050'. These codes differ between Classic and VPC environments and can change over time as Naver deprecates older images. Hardcoding them will break when Naver retires the image. ↓
fix Always fetch current product codes dynamically via getServerImageProductList() and getServerProductList() before creating instances. Cache the results but don't hardcode them.
gotcha The README installation instruction says 'pip install Setuptools' which is misleading — this is a general Python build tool, not the NCP SDK. Each NCP service is a separate PyPI package (ncloud-server, ncloud-vserver, ncloud-vpc, ncloud-cdn, etc.). There is no single 'pip install ncloud-sdk' that installs everything. ↓
fix Install only the service-specific packages you need: pip install ncloud-vserver ncloud-apikey for VPC servers, plus additional packages per service.
gotcha Credential loading order via ncloud_apikey.NcloudKey() is: (1) environment variables NCLOUD_ACCESS_KEY_ID / NCLOUD_SECRET_KEY, (2) config file at ~/.ncloud/configure, (3) Server Role metadata (VPC only). If none are present, the SDK raises a generic exception with no clear message about missing credentials. ↓
fix Set credentials via environment variables in CI/CD. Use ~/.ncloud/configure for local dev. The config file can be generated via the Ncloud CLI: ncloud configure.
gotcha NCP console, documentation, and support are primarily in Korean. English documentation at api.ncloud-docs.com exists but is less comprehensive and may lag behind Korean docs for newer services. ↓
fix Use English docs at api.ncloud-docs.com for API reference. For service-specific guides and troubleshooting, the Korean docs at guide.ncloud-docs.com are more complete.
gotcha NCP regions are Korea-centric. Primary region is KR (Korea). Additional regions include SGN (Singapore), JPN (Japan), USWN (US West), and DE (Germany). Not all services are available in all regions. Region availability must be checked per service. ↓
fix Specify the region explicitly when creating resources. Default region is KR if not specified.
Install
pip install ncloud-vserver ncloud-vpc ncloud-apikey pip install ncloud-server ncloud-apikey pip install ncloud-cdn ncloud-apikey Install compatibility verified last tested: 2026-05-12
python os / libc variant status wheel install import disk
3.10 alpine (musl) ncloud - - - -
3.10 alpine (musl) ncloud-cdn - - - -
3.10 alpine (musl) ncloud-server - - - -
3.10 alpine (musl) ncloud-vserver - - 0.43s 74.4M
3.10 slim (glibc) ncloud - - - -
3.10 slim (glibc) ncloud-cdn - - - -
3.10 slim (glibc) ncloud-server - - - -
3.10 slim (glibc) ncloud-vserver - - 0.29s 146M
3.11 alpine (musl) ncloud - - - -
3.11 alpine (musl) ncloud-cdn - - - -
3.11 alpine (musl) ncloud-server - - - -
3.11 alpine (musl) ncloud-vserver - - 0.59s 81.9M
3.11 slim (glibc) ncloud - - - -
3.11 slim (glibc) ncloud-cdn - - - -
3.11 slim (glibc) ncloud-server - - - -
3.11 slim (glibc) ncloud-vserver - - 0.48s 153M
3.12 alpine (musl) ncloud - - - -
3.12 alpine (musl) ncloud-cdn - - - -
3.12 alpine (musl) ncloud-server - - - -
3.12 alpine (musl) ncloud-vserver - - 0.52s 72.2M
3.12 slim (glibc) ncloud - - - -
3.12 slim (glibc) ncloud-cdn - - - -
3.12 slim (glibc) ncloud-server - - - -
3.12 slim (glibc) ncloud-vserver - - 0.52s 143M
3.13 alpine (musl) ncloud - - - -
3.13 alpine (musl) ncloud-cdn - - - -
3.13 alpine (musl) ncloud-server - - - -
3.13 alpine (musl) ncloud-vserver - - 0.49s 68.5M
3.13 slim (glibc) ncloud - - - -
3.13 slim (glibc) ncloud-cdn - - - -
3.13 slim (glibc) ncloud-server - - - -
3.13 slim (glibc) ncloud-vserver - - 0.48s 142M
3.9 alpine (musl) ncloud - - - -
3.9 alpine (musl) ncloud-cdn - - - -
3.9 alpine (musl) ncloud-server - - - -
3.9 alpine (musl) ncloud-vserver - - 0.40s 73.6M
3.9 slim (glibc) ncloud - - - -
3.9 slim (glibc) ncloud-cdn - - - -
3.9 slim (glibc) ncloud-server - - - -
3.9 slim (glibc) ncloud-vserver - - 0.32s 145M
Imports
- ncloud_vserver (VPC servers) wrong
import ncloud_server # This is Classic environment, not VPCcorrectimport ncloud_vserver from ncloud_vserver.api.v2_api import V2Api
Quickstart stale last tested: 2026-05-12
# Step 1: Set up credentials
# Option A: Config file at ~/.ncloud/configure
# [DEFAULT]
# ncloud_access_key_id = YOUR_ACCESS_KEY
# ncloud_secret_access_key = YOUR_SECRET_KEY
# Option B: Environment variables
# export NCLOUD_ACCESS_KEY_ID=YOUR_ACCESS_KEY
# export NCLOUD_SECRET_KEY=YOUR_SECRET_KEY
# Step 2: VPC Server operations (recommended for new accounts)
import ncloud_vserver
from ncloud_vserver.api.v2_api import V2Api
from ncloud_vserver.rest import ApiException
import ncloud_apikey
# Load credentials from config file or env vars
apikeys = ncloud_apikey.ncloud_key.NcloudKey().keys()
configuration = ncloud_vserver.Configuration()
configuration.access_key = apikeys['access_key']
configuration.secret_key = apikeys['secret_key']
api = V2Api(ncloud_vserver.ApiClient(configuration))
# List server instances
try:
response = api.get_server_instance_list(
ncloud_vserver.GetServerInstanceListRequest()
)
for server in response.get_server_instance_list_response.server_instance_list:
print(server.server_name, server.server_instance_status.code_name)
except ApiException as e:
print(f'API error: {e}')
# Create a server instance (VPC)
try:
request = ncloud_vserver.CreateServerInstancesRequest(
vpc_no='YOUR_VPC_NO',
subnet_no='YOUR_SUBNET_NO',
server_image_product_code='SW.VSVR.OS.LNX64.CNTOS.0703.B050', # CentOS 7
server_product_code='SVR.VSVR.STAND.C002.M008.NET.SSD050.B050.G002',
)
response = api.create_server_instances(request)
print(response)
except ApiException as e:
print(f'Create error: {e}')
# Classic environment (legacy — use only if on Classic account)
import ncloud_server
from ncloud_server.api.v2_api import V2Api as ClassicV2Api
classic_config = ncloud_server.Configuration()
classic_config.access_key = apikeys['access_key']
classic_config.secret_key = apikeys['secret_key']
classic_api = ClassicV2Api(ncloud_server.ApiClient(classic_config))
try:
response = classic_api.get_server_instance_list(
ncloud_server.GetServerInstanceListRequest()
)
except ApiException as e:
print(f'Classic API error: {e}')
# CDN (works for both Classic and VPC)
import ncloud_cdn
from ncloud_cdn.api.v2_api import V2Api as CdnV2Api
cdn_config = ncloud_cdn.Configuration()
cdn_config.access_key = apikeys['access_key']
cdn_config.secret_key = apikeys['secret_key']
cdn_api = CdnV2Api(ncloud_cdn.ApiClient(cdn_config))
try:
response = cdn_api.get_cdn_plus_instance_list(
ncloud_cdn.GetCdnPlusInstanceListRequest()
)
print(response)
except ApiException as e:
print(f'CDN error: {e}')