Unable to create template or pod with python sdk version 1.6.2

import runpod
import os


runpod.api_key = os.getenv("RUNPOD_API_KEY")

try:
# Creating a new template with a specified name and Docker image
new_template = runpod.create_template(name="test", image_name="runpod/base:0.1.0")

# Output the created template details
print(new_template)

except Exception as err:
# Handling potential errors during template creation
print(err)
# print(err.query)
import runpod
import os


runpod.api_key = os.getenv("RUNPOD_API_KEY")

try:
# Creating a new template with a specified name and Docker image
new_template = runpod.create_template(name="test", image_name="runpod/base:0.1.0")

# Output the created template details
print(new_template)

except Exception as err:
# Handling potential errors during template creation
print(err)
# print(err.query)
Error Output:
$ python runpod.py
partially initialized module 'runpod' has no attribute 'create_template' (most likely due to a circular import)
module 'runpod' has no attribute 'create_template'
$ python runpod.py
partially initialized module 'runpod' has no attribute 'create_template' (most likely due to a circular import)
module 'runpod' has no attribute 'create_template'
Solution:
You called your script runpod.py, so it conflicts with the runpod module. You can't do that, give your script a different name.
Jump to solution
5 Replies
Solution
digigoblin
digigoblin6mo ago
You called your script runpod.py, so it conflicts with the runpod module. You can't do that, give your script a different name.
Asad Cognify
Asad CognifyOP6mo ago
all right Working now
digigoblin
digigoblin6mo ago
yep
Asad Cognify
Asad CognifyOP6mo ago
Can I just specify the template ID or name when creating a pod?
create_pod(
name: str,
image_name: str,
gpu_type_id: str,
cloud_type: str = "ALL",
support_public_ip: bool = True,
start_ssh: bool = True,
data_center_id: Optional[str] = None,
country_code: Optional[str] = None,
gpu_count: int = 1,
volume_in_gb: int = 0,
container_disk_in_gb: Optional[int] = None,
min_vcpu_count: int = 1,
min_memory_in_gb: int = 1,
docker_args: str = "",
ports: Optional[str] = None,
volume_mount_path: str = "/runpod-volume",
env: Optional[dict] = None,
template_id: Optional[str] = None,
network_volume_id: Optional[str] = None,
allowed_cuda_versions: Optional[list] = None,
)
create_pod(
name: str,
image_name: str,
gpu_type_id: str,
cloud_type: str = "ALL",
support_public_ip: bool = True,
start_ssh: bool = True,
data_center_id: Optional[str] = None,
country_code: Optional[str] = None,
gpu_count: int = 1,
volume_in_gb: int = 0,
container_disk_in_gb: Optional[int] = None,
min_vcpu_count: int = 1,
min_memory_in_gb: int = 1,
docker_args: str = "",
ports: Optional[str] = None,
volume_mount_path: str = "/runpod-volume",
env: Optional[dict] = None,
template_id: Optional[str] = None,
network_volume_id: Optional[str] = None,
allowed_cuda_versions: Optional[list] = None,
)
nerdylive
nerdylive6mo ago
template id template_id: Optional[str] = None, this right
Want results from more Discord servers?
Add your server